Skip to content

Commit

Permalink
Merge branch 'main' into reese-lee-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
reese-lee authored Dec 16, 2024
2 parents 8a4910c + 2e2dbbb commit 8d7a910
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 22 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/auto-update-community-members.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '22'

Expand All @@ -35,6 +35,9 @@ jobs:
uses: peter-evans/create-pull-request@v7
with:
add-paths: 'data/community/members.yaml'
author:
opentelemetrybot
<[email protected]>
committer:
opentelemetrybot
<[email protected]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ should not generally be included in the metric name. Prometheus conventions
[recommend](https://prometheus.io/docs/practices/naming/#metric-names) that the
unit be included as a suffix of the metric name. OpenMetrics goes a step further
and
[requires this unit suffix](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#unit).
[requires this unit suffix](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#unit).
Currently, when exporting in Prometheus format from an OpenTelemetry SDK, the
unit is added as a suffix to the metric name.

Expand Down
Binary file added content/en/docs/demo/services/cart/exemplars.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ Action<ResourceBuilder> appResourceBuilder =
builder.Services.AddOpenTelemetry()
.ConfigureResource(appResourceBuilder)
.WithTracing(tracerBuilder => tracerBuilder
.AddSource("OpenTelemetry.Demo.Cart")
.AddRedisInstrumentation(
cartStore.GetConnection(),
options => options.SetVerboseDatabaseStatements = true)
.AddAspNetCoreInstrumentation()
.AddGrpcClientInstrumentation()
Expand Down Expand Up @@ -87,12 +87,85 @@ Action<ResourceBuilder> appResourceBuilder =
builder.Services.AddOpenTelemetry()
.ConfigureResource(appResourceBuilder)
.WithMetrics(meterBuilder => meterBuilder
.AddMeter("OpenTelemetry.Demo.Cart")
.AddProcessInstrumentation()
.AddRuntimeInstrumentation()
.AddAspNetCoreInstrumentation()
.SetExemplarFilter(ExemplarFilterType.TraceBased)
.AddOtlpExporter());
```

### Exemplars

[Exemplars](/docs/specs/otel/metrics/data-model/#exemplars) are configured in
the Cart service with trace-based exemplar filter, which enables the
OpenTelemetry SDK to attach exemplars to metrics.

First it creates a `CartActivitySource`, `Meter` and two `Histograms`. The
histogram keeps track from the latency of the methods `AddItem` and `GetCart`,
as those are two important methods in the Cart service.

Those two methods are critical to the Cart service as users shouldn't wait too
long when adding an item to the cart, or when viewing their cart before moving
to the checkout process.

```cs
private static readonly ActivitySource CartActivitySource = new("OpenTelemetry.Demo.Cart");
private static readonly Meter CartMeter = new Meter("OpenTelemetry.Demo.Cart");
private static readonly Histogram<long> addItemHistogram = CartMeter.CreateHistogram<long>(
"app.cart.add_item.latency",
advice: new InstrumentAdvice<long>
{
HistogramBucketBoundaries = [ 500000, 600000, 700000, 800000, 900000, 1000000, 1100000 ]
});
private static readonly Histogram<long> getCartHistogram = CartMeter.CreateHistogram<long>(
"app.cart.get_cart.latency",
advice: new InstrumentAdvice<long>
{
HistogramBucketBoundaries = [ 300000, 400000, 500000, 600000, 700000, 800000, 900000 ]
});
```

Note that a custom bucket boundary is also defined, as the default values don't
fit the microseconds results Cart service has.

Once the variables are defined, the latency of the execution of each method is
tracked with a `StopWatch` as follows:

```cs
var stopwatch = Stopwatch.StartNew();

(method logic)

addItemHistogram.Record(stopwatch.ElapsedTicks);
```

To connect it all together, in the Traces pipeline, it is required to add the
created source. (Already present in the snippet above, but added here to
reference):

```cs
.AddSource("OpenTelemetry.Demo.Cart")
```

And, in the Metrics pipeline, the `Meter` and the `ExemplarFilter`:

```cs
.AddMeter("OpenTelemetry.Demo.Cart")
.SetExemplarFilter(ExemplarFilterType.TraceBased)
```

To visualize the Exemplars, navigate to Grafana
<http://localhost:8080/grafana> > Dashboards > Demo > Cart Service Exemplars.

Exemplars appear as special "diamond-shaped dots" on the 95th percentile chart
or as small squares on the heatmap chart. Select any exemplar to view its data,
which includes the timestamp of the measurement, the raw value, and the trace
context at the time of recording. The `trace_id` enables navigation to the
tracing backend (Jaeger, in this case).

![Cart Service Exemplars](exemplars.png)

## Logs

Logs are configured in the .NET dependency injection container on
Expand Down
2 changes: 1 addition & 1 deletion content/en/docs/languages/java/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cascade:
vers:
instrumentation: 2.10.0
otel: 1.45.0
contrib: 1.41.0
contrib: 1.42.0
semconv: 1.28.0
weight: 18
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,16 @@ The OpenTelemetry starter uses OpenTelemetry Spring Boot
{{< tabpane text=true >}} {{% tab header="Maven (`pom.xml`)" lang=Maven %}}

```xml
<dependencies>
<dependency>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-spring-boot-starter</artifactId>
</dependency>
</dependencies>
</dependency>
```

{{% /tab %}} {{% tab header="Gradle (`gradle.build`)" lang=Gradle %}}

```kotlin
dependencies {
implementation("io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter")
}
implementation("io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter")
```

{{% /tab %}} {{< /tabpane>}}
27 changes: 17 additions & 10 deletions data/community/members.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,6 @@ maintainers:
- helm-approvers
- helm-maintainers
- helm-triagers
- operator-approvers
- semconv-container-approvers
- semconv-k8s-approvers
- semconv-system-approvers
Expand Down Expand Up @@ -487,6 +486,16 @@ maintainers:
- profiling-triagers
html_url: https://github.com/felixge
avatar_url: https://avatars.githubusercontent.com/u/15000?v=4
- name: frzifus
teams:
- collector-contrib-triagers
- operator-approvers
- operator-maintainers
- semconv-container-approvers
- semconv-k8s-approvers
- semconv-system-approvers
html_url: https://github.com/frzifus
avatar_url: https://avatars.githubusercontent.com/u/10403402?v=4
- name: hauleth
teams:
- erlang-approvers
Expand Down Expand Up @@ -605,6 +614,7 @@ maintainers:
- specs-semconv-maintainers
- specs-triagers
- sqlcommenter-approvers
- weaver-approvers
- weaver-maintainers
html_url: https://github.com/jsuereth
avatar_url: https://avatars.githubusercontent.com/u/29006?v=4
Expand Down Expand Up @@ -700,6 +710,7 @@ maintainers:
teams:
- arrow-approvers
- arrow-maintainers
- weaver-approvers
- weaver-maintainers
html_url: https://github.com/lquerel
avatar_url: https://avatars.githubusercontent.com/u/657994?v=4
Expand Down Expand Up @@ -1404,15 +1415,6 @@ approvers:
- ebpf-profiler-approvers
html_url: https://github.com/florianl
avatar_url: https://avatars.githubusercontent.com/u/1132494?v=4
- name: frzifus
teams:
- collector-contrib-triagers
- operator-approvers
- semconv-container-approvers
- semconv-k8s-approvers
- semconv-system-approvers
html_url: https://github.com/frzifus
avatar_url: https://avatars.githubusercontent.com/u/10403402?v=4
- name: grcevski
teams:
- go-instrumentation-approvers
Expand Down Expand Up @@ -1472,6 +1474,11 @@ approvers:
- java-instrumentation-triagers
html_url: https://github.com/jeanbisutti
avatar_url: https://avatars.githubusercontent.com/u/14811066?v=4
- name: jerbly
teams:
- weaver-approvers
html_url: https://github.com/jerbly
avatar_url: https://avatars.githubusercontent.com/u/1909032?v=4
- name: jeremydvoss
teams:
- opentelemetry-python-contrib-approvers
Expand Down
2 changes: 1 addition & 1 deletion data/registry/exporter-js-sap-cloud-logging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ isFirstParty: false
package:
registry: npm
name: '@sap/opentelemetry-exporter-for-sap-cloud-logging'
version: 0.2.0
version: 0.3.0
4 changes: 4 additions & 0 deletions static/refcache.json
Original file line number Diff line number Diff line change
Expand Up @@ -5531,6 +5531,10 @@
"StatusCode": 200,
"LastSeen": "2024-01-18T19:12:13.077443-05:00"
},
"https://github.com/jerbly": {
"StatusCode": 200,
"LastSeen": "2024-12-16T09:49:23.729890443Z"
},
"https://github.com/jeremydvoss": {
"StatusCode": 200,
"LastSeen": "2024-08-06T15:16:01.174042+02:00"
Expand Down

0 comments on commit 8d7a910

Please sign in to comment.