Skip to content

Commit

Permalink
Merge branch 'open-telemetry:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorsesan authored Nov 20, 2024
2 parents e3526d1 + 1712625 commit 3eb4858
Show file tree
Hide file tree
Showing 13 changed files with 1,537 additions and 1,493 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
[submodule "content-modules/opentelemetry-java-examples"]
path = content-modules/opentelemetry-java-examples
url = https://github.com/open-telemetry/opentelemetry-java-examples.git
javaexamples-pin = 0f736ec
javaexamples-pin = f9553ef
2 changes: 1 addition & 1 deletion content-modules/opentelemetry-java-examples
2 changes: 1 addition & 1 deletion content/en/docs/collector/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Collector
description: Vendor-agnostic way to receive, process and export telemetry data.
aliases: [collector/about]
cascade:
vers: 0.113.0
vers: 0.114.0
weight: 270
---

Expand Down
177 changes: 80 additions & 97 deletions content/en/docs/collector/internal-telemetry.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions content/en/docs/languages/go/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ application that exports telemetry.
Create `otel.go` with OpenTelemetry SDK bootstrapping code:

<!-- prettier-ignore-start -->
<?code-excerpt "otel.go" from="package main"?>
<!-- code-excerpt "otel.go" from="package main"?-->
```go
package main

Expand Down Expand Up @@ -273,7 +273,7 @@ Modify `main.go` to include code that sets up OpenTelemetry SDK and instruments
the HTTP server using the `otelhttp` instrumentation library:

<!-- prettier-ignore-start -->
<?code-excerpt "main.go" from="package main"?>
<!--?code-excerpt "main.go" from="package main"?-->
```go
package main

Expand Down Expand Up @@ -372,7 +372,7 @@ your application. For that you'll need to write some custom
Modify `rolldice.go` to include custom instrumentation using OpenTelemetry API:

<!-- prettier-ignore-start -->
<?code-excerpt "rolldice.go" from="package main"?>
<!--?code-excerpt "rolldice.go" from="package main"?-->
```go
package main

Expand Down
24 changes: 23 additions & 1 deletion content/en/docs/languages/java/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,14 @@ responsible for handling metric telemetry produced by the API.

- [Resource](#resource): The resource metrics are associated with.
- [MetricReader](#metricreader): Reads the aggregated state of metrics.
- Optionally, with
[CardinalityLimitSelector](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-metrics/latest/io/opentelemetry/sdk/metrics/export/CardinalityLimitSelector.html)
for overriding cardinality limit by instrument kind. If unset, each
instrument is limited to 2000 unique combinations of attributes per
collection cycle. Cardinality limits are also configurable for individual
instruments via [views](#views). See
[cardinality limits](/docs/specs/otel/metrics/sdk/#cardinality-limits) for
more details.
- [MetricExporter](#metricexporter): Exports metrics out of process (in
conjunction with associated `MetricReader`).
- [Views](#views): Configures metric streams, including dropping unused metrics.
Expand Down Expand Up @@ -592,11 +600,18 @@ public class SdkMeterProviderConfig {
MetricReaderConfig.periodicMetricReader(
MetricExporterConfig.otlpHttpMetricExporter(
"http://localhost:4318/v1/metrics")));
// Uncomment to optionally register metric reader with cardinality limits
// builder.registerMetricReader(
// MetricReaderConfig.periodicMetricReader(
// MetricExporterConfig.otlpHttpMetricExporter("http://localhost:4318/v1/metrics")),
// instrumentType -> 100);

ViewConfig.dropMetricView(builder, "some.custom.metric");
ViewConfig.histogramBucketBoundariesView(
builder, "http.server.request.duration", List.of(1.0, 5.0, 10.0));
ViewConfig.attributeFilterView(
builder, "http.client.request.duration", Set.of("http.request.method"));
ViewConfig.cardinalityLimitsView(builder, "http.server.active_requests", 100);
return builder.build();
}
}
Expand Down Expand Up @@ -872,7 +887,7 @@ public class CustomMetricExporter implements MetricExporter {
[Views](https://www.javadoc.io/doc/io.opentelemetry/opentelemetry-sdk-metrics/latest/io/opentelemetry/sdk/metrics/View.html)
allow metric streams to be customized, including changing metric names, metric
descriptions, metric aggregations (i.e. histogram bucket boundaries), the set of
attribute keys to retain, etc.
attribute keys to retain, cardinality limit, etc.

{{% alert %}} Views have somewhat unintuitive behavior when multiple match a
particular instrument. If one matching view changes the metric name and another
Expand Down Expand Up @@ -920,6 +935,13 @@ public class ViewConfig {
InstrumentSelector.builder().setName(metricName).build(),
View.builder().setAttributeFilter(keysToRetain).build());
}

public static SdkMeterProviderBuilder cardinalityLimitsView(
SdkMeterProviderBuilder builder, String metricName, int cardinalityLimit) {
return builder.registerView(
InstrumentSelector.builder().setName(metricName).build(),
View.builder().setCardinalityLimit(cardinalityLimit).build());
}
}
```
<!-- prettier-ignore-end -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Out of the box instrumentation is available for several frameworks:
| --------------------- | ----------------------------------------------- | ------------- |
| JDBC | `otel.instrumentation.jdbc.enabled` | true |
| Logback | `otel.instrumentation.logback-appender.enabled` | true |
| Logback MDC | `otel.instrumentation.logback-mdc.enabled` | true |
| Spring Web | `otel.instrumentation.spring-web.enabled` | true |
| Spring Web MVC | `otel.instrumentation.spring-webmvc.enabled` | true |
| Spring WebFlux | `otel.instrumentation.spring-webflux.enabled` | true |
Expand Down
Loading

0 comments on commit 3eb4858

Please sign in to comment.