1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-09-16 09:26:25 +02:00
Go to file
David Ashpole 567ef26abf Add benchmark for exponential histogram measurements (#7305)
This is helpful for my work optimizing locking in
https://github.com/open-telemetry/opentelemetry-go/pull/7189

```
goos: linux
goarch: amd64
pkg: go.opentelemetry.io/otel/sdk/metric
cpu: Intel(R) Xeon(R) CPU @ 2.20GHz
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/0-24         	   43419	       306.0 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/0-24         	   40675	       316.1 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/0-24         	   53746	       305.6 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/0-24         	   38224	       296.1 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/0-24         	   53796	       330.3 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/0-24         	   47823	       316.4 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/1-24         	   32172	       373.5 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/1-24         	   33084	       379.0 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/1-24         	   29956	       360.4 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/1-24         	   33921	       370.1 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/1-24         	   34449	       387.7 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/1-24         	   29156	       393.6 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/10-24        	   10768	      1040 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/10-24        	   11190	      1056 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/10-24        	   11078	      1176 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/10-24        	   10929	      1219 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/10-24        	   10454	      1066 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/NoView/ExponentialFloat64Histogram/Attributes/10-24        	   10501	      1064 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/0-24       	 5919898	         1.879 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/0-24       	 5834685	         1.990 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/0-24       	 5782334	         2.433 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/0-24       	 5320924	         2.404 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/0-24       	 5742800	         2.109 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/0-24       	 5885475	         2.056 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/1-24       	 4331547	         2.758 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/1-24       	 3848244	         2.725 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/1-24       	 4542189	         2.636 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/1-24       	 4201015	         2.641 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/1-24       	 4597094	         2.608 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/1-24       	 4869811	         2.491 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/10-24      	 4826077	         2.329 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/10-24      	 4866612	         2.382 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/10-24      	 5149305	         2.310 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/10-24      	 5101305	         2.384 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/10-24      	 4854940	         2.440 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/DropView/ExponentialFloat64Histogram/Attributes/10-24      	 4874742	         2.501 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/0-24 	   55272	       359.0 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/0-24 	   52195	       318.4 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/0-24 	   52324	       330.8 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/0-24 	   49879	       321.4 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/0-24 	   56212	       351.3 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/0-24 	   43362	       301.4 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/1-24 	   30296	       461.9 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/1-24 	   24178	       469.0 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/1-24 	   24901	       477.0 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/1-24 	   21748	       477.6 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/1-24 	   23972	       512.9 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/1-24 	   28039	       499.5 ns/op	       0 B/op	       0 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/10-24         	    7598	      1646 ns/op	     704 B/op	       2 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/10-24         	    7452	      1660 ns/op	     704 B/op	       2 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/10-24         	    7620	      1644 ns/op	     704 B/op	       2 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/10-24         	    6459	      1853 ns/op	     704 B/op	       2 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/10-24         	    7950	      1575 ns/op	     704 B/op	       2 allocs/op
BenchmarkSyncMeasure/AttrFilterView/ExponentialFloat64Histogram/Attributes/10-24         	    8948	      1421 ns/op	     704 B/op	       2 allocs/op
```
2025-09-08 09:19:44 +02:00
2025-07-29 10:19:11 +02:00
2025-09-02 14:51:02 +02:00
2025-09-02 14:51:02 +02:00
2025-08-31 07:52:30 -07:00
2025-01-29 14:20:03 -08:00
2025-07-23 17:51:03 -07:00
2025-08-31 07:52:30 -07:00
2025-07-02 09:38:02 +02:00
2025-08-31 07:52:30 -07:00
2025-08-29 12:42:52 -07:00
2025-08-29 12:42:52 -07:00

OpenTelemetry-Go

ci codecov.io PkgGoDev Go Report Card OpenSSF Scorecard OpenSSF Best Practices Fuzzing Status FOSSA Status Slack

OpenTelemetry-Go is the Go implementation of OpenTelemetry. It provides a set of APIs to directly measure performance and behavior of your software and send this data to observability platforms.

Project Status

Signal Status
Traces Stable
Metrics Stable
Logs Beta1

Progress and status specific to this repository is tracked in our project boards and milestones.

Project versioning information and stability guarantees can be found in the versioning documentation.

Compatibility

OpenTelemetry-Go ensures compatibility with the current supported versions of the Go language:

Each major Go release is supported until there are two newer major releases. For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was supported until the Go 1.8 release.

For versions of Go that are no longer supported upstream, opentelemetry-go will stop ensuring compatibility with these versions in the following manner:

  • A minor release of opentelemetry-go will be made to add support for the new supported release of Go.
  • The following minor release of opentelemetry-go will remove compatibility testing for the oldest (now archived upstream) version of Go. This, and future, releases of opentelemetry-go may include features only supported by the currently supported versions of Go.

Currently, this project supports the following environments.

OS Go Version Architecture
Ubuntu 1.25 amd64
Ubuntu 1.24 amd64
Ubuntu 1.25 386
Ubuntu 1.24 386
Ubuntu 1.25 arm64
Ubuntu 1.24 arm64
macOS 13 1.25 amd64
macOS 13 1.24 amd64
macOS 1.25 arm64
macOS 1.24 arm64
Windows 1.25 amd64
Windows 1.24 amd64
Windows 1.25 386
Windows 1.24 386

While this project should work for other systems, no compatibility guarantees are made for those systems currently.

Getting Started

You can find a getting started guide on opentelemetry.io.

OpenTelemetry's goal is to provide a single set of APIs to capture distributed traces and metrics from your application and send them to an observability platform. This project allows you to do just that for applications written in Go. There are two steps to this process: instrument your application, and configure an exporter.

Instrumentation

To start capturing distributed traces and metric events from your application it first needs to be instrumented. The easiest way to do this is by using an instrumentation library for your code. Be sure to check out the officially supported instrumentation libraries.

If you need to extend the telemetry an instrumentation library provides or want to build your own instrumentation for your application directly you will need to use the Go otel package. The examples are a good way to see some practical uses of this process.

Export

Now that your application is instrumented to collect telemetry, it needs an export pipeline to send that telemetry to an observability platform.

All officially supported exporters for the OpenTelemetry project are contained in the exporters directory.

Exporter Logs Metrics Traces
OTLP
Prometheus
stdout
Zipkin

Contributing

See the contributing documentation.

Languages
Go 99.8%
Jinja 0.1%