Commit Graph

31 Commits

Author SHA1 Message Date
Jamie Tanna 0879ce538f feat(instrumentation): add support for protobuf + gRPC exporter (#45527)
As noted in #36073, having support for the different protocols for
exporting OpenTelemetry data would be useful, especially if this is
leading to users seeing issues when they have auto-injected
configuration being set.

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
2026-08-28 11:28:53 +00:00
Jamie Tanna adbc20e88e feat(instrumentation): allow exporting OTLP JSON file (#42284)
* feat(instrumentation): allow exporting OTLP JSON file

We've recently been investing in improvements to Renovate's
OpenTelemetry instrumentation to improve debuggability and
supportability.

However, not everyone has an immediately available OpenTelemetry
Collector, so the added instrumentation isn't useful to those users.

Instead, we can provide a way to export to the OTLP file format, which
provides a means to export the data to disk and then consume it later.

This will also support use-cases like running in a CI platform like
GitHub Actions and GitLab CI, where OpenTelemetry Collectors may not be
exposed in that environment, but a post-run execution can export it.

We now need to make sure that `RENOVATE_USE_CLOUD_METADATA_SERVICES` is
never set, as `isTracingEnabled` will now resolve true, and the Cloud
Metadata Resource Detectors will be used.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>

* fixup! feat(instrumentation): allow exporting OTLP JSON file

* fixup! fixup! feat(instrumentation): allow exporting OTLP JSON file

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>

* fixup! feat(instrumentation): allow exporting OTLP JSON file

---------

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-07-22 12:26:16 +00:00
Mike Ryan f635ae29c4 chore(instrumentation): add timing statistics for getReleases (#42523)
* feat: timing statistics for getReleases

Adds collection and reporting of timing statistics for
`datasource.getReleases()` calls. Each call records the datasource, registryUrl,
packageName, and duration. The intent is to visibility into where
renovate is retrieving release information and how long that might take.

The report consists of a nested data-structure that provides increasing
detail as we descend datasource, registryUrl, and packageName.

The full report  is logged at trace level
`getReleases statistics with packages`.

A summary report including only datasources and registryUrls is logged
at debug level `getReleases statistics summary`.

* add GetReleasesSpanProcessor

- Re-instrument getReleases calls using open telemetry.
- Adds GetReleasesSpanProcessor, which can adapt
  `getReleases` spans to GetReleasesStats.

* fixup instrumentation tests

* pr feedback

* pr feedback: naming

* pr feedback: comments
2026-04-14 17:36:37 +00:00
Jamie Tanna 470ee61dd7 fix(instrumentation): always process Git Operation spans (#42119)
* fix(instrumentation): always process Git Operation spans

As part of b5cd0317cf we added the ability
to report the `Git Operations Statistics` at the end of the Renovate
run, by introducing a `SpanProcessor`.

However, this didn't correctly take into account the fact that this
would only be enabled if Renovate was configured to log/export traces,
which is not the case in most deployments.

As noted in #42118, this leads to a blank log line output, which isn't
very useful.

To correct this, we nede to always process these spans, even if tracing
is not enabled.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>

* fixup! fix(instrumentation): always process Git Operation spans

* fixup! fixup! fix(instrumentation): always process Git Operation spans

* fixup! fixup! fix(instrumentation): always process Git Operation spans

---------

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-03-25 12:41:47 +00:00
Jamie Tanna 3f9b23d989 chore(instrumentation): remove TODO (#42133)
As noted by Michael, this was likely fixed as part of other changes he'd
made recently around logging.

Co-authored-by: Michael Kriese <1798109+viceice@users.noreply.github.com>
2026-03-25 11:48:41 +00:00
Michael Kriese 242068db80 fix(instrumentation): ignore docker api auth check (#41548) 2026-02-27 14:10:53 +00:00
Michael Kriese f7efd7d426 feat(instrumentation): allow disabling cloud detectors (#41401)
* feat(otel): allow disabling cloud detectors

* docs(otel): add missing env

* feat: implement `OTEL_NODE_RESOURCE_DETECTORS`

* test: drop snapshot

* Update lib/instrumentation/reporting.spec.ts

Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>

* docs: update otel docs

---------

Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2026-02-25 08:10:03 +00:00
Michael Kriese ea089ac660 build: lazy load initialization modules (#41408)
* build: lazy load initialization modules

* test: fix otel test

* test: drop unused
2026-02-23 14:17:18 +00:00
Michael Kriese e34f867da6 feat(otel): support diagnostics debugging (#41362) 2026-02-21 11:33:54 +00:00
Sergei Zharinov 2b0e80b884 feat!: Switch to ESM modules (#40756) 2026-01-29 14:21:41 +00:00
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00
Michael Kriese 0785d0b8bc test: add coverage (part2) (#40643) 2026-01-23 20:57:46 +00:00
Jamie Tanna b5cd0317cf fix(git): report Git operation statistics at end of run (#39596)
Now we have instrumented our Git operations with tracing, we can make
sure that users who are not using OpenTelemetry still get insights into
their Git operation usage using a debug log output.

Following how other insights are produced, we can introduce a new type
in `lib/util/stats` for `GitOperationStats`, which will track the
overall execution for each operation type, and output them in the same
style as we use for other timing reports.

At the end of a Renovate run, we'll then make sure that this is logged
into a debug log for further investigation.

To create the report, we can make sure that we introduce a new
OpenTelemetry `SpanProcessor`, which will run when we end our Run, and
store any Git operations in `GitOperationStats`.

This adapts code from GPT-4.1 and code from [0].

Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>

[0]: https://github.com/yurisouza/monitoria-sdk/blob/ca9d751fa7c3a785a04f87b8966bb782b4617021/src/adapters/nestjs/span-duration-tracker.ts#L18-L27
2025-12-01 15:53:26 +00:00
Jamie Tanna 7f6fcfbaaa fix(instrumentation): handle Promise-like objects as Promises (#39661)
When instrumenting, we specifically handle Promises. However, if we have
an object, like SimpleGit's `Response`:

```
export type Response<T> = SimpleGit & Promise<T>;
```

This does not get correctly instrumented, and we end up not waiting for
the function call to complete.

We can make sure we use `isPromise` to correctly check if it's a native
Promise, or something with a Promise-like API.
2025-12-01 14:58:25 +00:00
Jamie Tanna ce729a84c4 chore(telemetry): add span attribute for splits (#38633)
As part of a step towards better OpenTelemetry instrumentation as part
of #38609, we can start by introducing a known span attribute for the
repository "split" we're currently processing.

This requires a slight refactor of the `SpanOptions`, to use our custom
type, which enforces the `RenovateSplit` type when using the span name.

This adds it into each of the splits we currently instrument.

Co-authored-by: secustor <sebastian@poxhofer.at>
2025-11-28 12:32:00 +00:00
Jamie Tanna dc046cac54 chore(instrumentation): add a 4-parameter overload (#39588)
Without this, we cannot call `instrument` with the 4 parameters,
otherwise we receive a Typescript error.

Co-authored-by: gpt-4.1 <jamie.tanna+github-copilot@mend.io>
2025-11-28 09:13:47 +00:00
Michael Kriese 050ac8d23b chore: better code coverage (#39518) 2025-11-25 15:01:54 +00:00
Michele Azzolari 250b18fa54 feat(instrumentation): instrument redis (#39427) 2025-11-20 15:14:06 +00:00
RahulGautamSingh 49fa1be464 feat(util): getEnv (#35161)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-05-06 18:37:28 +00:00
seiyar81 12bc4da241 feat(instrumentation): use @opentelemetry resources detectors (#34904) 2025-04-15 10:05:37 +00:00
renovate[bot] 74cc313818 build(deps): update opentelemetry-js monorepo to v2 (main) (major) (#34981)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2025-03-24 22:28:50 +00:00
Michael Kriese b5ff90f2bd fix: improve coverage (#34667) 2025-03-06 17:05:19 +00:00
Michael Kriese bb5377b3d8 test: fix code coverage (#34495) 2025-02-26 12:40:30 +00:00
renovate[bot] d97b010c42 build(deps): update dependency @opentelemetry/semantic-conventions to v1.29.0 (#34217)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2025-02-18 14:47:54 +00:00
Sebastian Poxhofer 8e267a6aca fix(instrumentation/otel): only use strings for span status and record exception (#31481) 2024-09-19 19:44:15 +00:00
Sebastian Poxhofer 3681b2a945 chore: eslint to enforce for typed imports (#30844) 2024-08-19 13:15:27 +00:00
Sergei Zharinov 29b4db980e refactor(instrumentation): Remove unused span parameter (#30861) 2024-08-19 04:52:09 +00:00
AvivGuiser 4914b6c26c feat(instrumentation): add option to overwrite otlp service name/namespace/version with env var (#29583)
Signed-off-by: Aviv Guiser <avivguiser@gmail.com>
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
2024-06-12 10:24:45 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
Jamie Magee 176282e65f chore: use node: protocol imports (#21181) 2023-03-28 21:05:36 +00:00
Sebastian Poxhofer b53c581e5c feat(telemetry): add OpenTelemetry tracing MVC (#15731) 2022-10-23 06:48:35 +02:00