Skip to content

Commit 1da8fae

Browse files
authored
Create OpenTelemetry Bridge for Tracing (#4834)
* Creating otel bridge Signed-off-by: Alan Protasio <approtas@amazon.com> * Changing doc Signed-off-by: Alan Protasio <approtas@amazon.com> * run make clean-white-noise Signed-off-by: Alan Protasio <approtas@amazon.com> * Keeping otel span on alert maanager do quorum Signed-off-by: Alan Protasio <approtas@amazon.com> * Changing doc Signed-off-by: Alan Protasio <approtas@amazon.com> * Update change log Signed-off-by: Alan Protasio <approtas@amazon.com> * doc Signed-off-by: Alan Protasio <approtas@amazon.com> * changelog Signed-off-by: Alan Protasio <approtas@amazon.com> * comments Signed-off-by: Alan Protasio <approtas@amazon.com> Signed-off-by: Alan Protasio <approtas@amazon.com>
1 parent 4bb8f24 commit 1da8fae

File tree

149 files changed

+18099
-576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+18099
-576
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@
4646
* [FEATURE] Compactor: Added `-compactor.block-files-concurrency` allowing to configure number of go routines for download/upload block files during compaction. #4784
4747
* [FEATURE] Compactor: Added -compactor.blocks-fetch-concurrency` allowing to configure number of go routines for blocks during compaction. #4787
4848
* [FEATURE] Compactor: Added configurations for Azure MSI in blocks-storage, ruler-storage and alertmanager-storage. #4818
49-
* [FEATURE] Ruler: Add support to pass custom implementations of queryable and pusher #4782
49+
* [FEATURE] Ruler: Add support to pass custom implementations of queryable and pusher. #4782
50+
* [FEATURE] Create OpenTelemetry Bridge for Tracing. Now cortex can send traces to multiple destinations using OTEL Collectors. #4834
5051
* [BUGFIX] Memberlist: Add join with no retrying when starting service. #4804
51-
* [BUGFIX] Ruler: Fix /ruler/rule_groups returns YAML with extra fields #4767
52+
* [BUGFIX] Ruler: Fix /ruler/rule_groups returns YAML with extra fields. #4767
5253

5354
## 1.13.0 2022-07-14
5455

cmd/cortex/main.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package main
22

33
import (
4+
"context"
45
"crypto/sha256"
56
"flag"
67
"fmt"
@@ -16,10 +17,10 @@ import (
1617
"github.com/pkg/errors"
1718
"github.com/prometheus/client_golang/prometheus"
1819
"github.com/prometheus/common/version"
19-
"github.com/weaveworks/common/tracing"
2020
"gopkg.in/yaml.v2"
2121

2222
"github.com/cortexproject/cortex/pkg/cortex"
23+
"github.com/cortexproject/cortex/pkg/tracing"
2324
"github.com/cortexproject/cortex/pkg/util"
2425
"github.com/cortexproject/cortex/pkg/util/flagext"
2526
util_log "github.com/cortexproject/cortex/pkg/util/log"
@@ -149,19 +150,19 @@ func main() {
149150

150151
util.InitEvents(eventSampleRate)
151152

152-
// In testing mode skip JAEGER setup to avoid panic due to
153+
ctx, cancelFn := context.WithCancel(context.Background())
154+
// In testing mode skip tracing setup to avoid panic due to
153155
// "duplicate metrics collector registration attempted"
154156
if !testMode {
155157
name := "cortex"
156158
if len(cfg.Target) == 1 {
157159
name += "-" + cfg.Target[0]
158160
}
159161

160-
// Setting the environment variable JAEGER_AGENT_HOST enables tracing.
161-
if trace, err := tracing.NewFromEnv(name); err != nil {
162+
if close, err := tracing.SetupTracing(ctx, name, cfg.Tracing); err != nil {
162163
level.Error(util_log.Logger).Log("msg", "Failed to setup tracing", "err", err.Error())
163164
} else {
164-
defer trace.Close()
165+
defer close(ctx) // nolint:errcheck
165166
}
166167
}
167168

@@ -193,6 +194,7 @@ func main() {
193194
level.Info(util_log.Logger).Log("msg", "Starting Cortex", "version", version.Info())
194195

195196
err = t.Run()
197+
cancelFn()
196198

197199
runtime.KeepAlive(ballast)
198200
util_log.CheckFatal("running cortex", err)

docs/configuration/config-file-reference.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ query_scheduler:
250250
# Skip validating server certificate.
251251
# CLI flag: -query-scheduler.grpc-client-config.tls-insecure-skip-verify
252252
[tls_insecure_skip_verify: <boolean> | default = false]
253+
254+
# The tracing_config configures backends cortex uses.
255+
[tracing: <tracing_config>]
253256
```
254257
255258
### `server_config`
@@ -3969,3 +3972,34 @@ The `s3_sse_config` configures the S3 server-side encryption. The supported CLI
39693972
# CLI flag: -<prefix>.s3.sse.kms-encryption-context
39703973
[kms_encryption_context: <string> | default = ""]
39713974
```
3975+
3976+
### `tracing_config`
3977+
3978+
The `tracing_config` configures backends cortex uses.
3979+
3980+
```yaml
3981+
# Tracing type. OTEL and JAEGER are currently supported. For jaeger
3982+
# `JAEGER_AGENT_HOST` environment variable should also be set. See:
3983+
# https://cortexmetrics.io/docs/guides/tracing .
3984+
# CLI flag: -tracing.type
3985+
[type: <string> | default = "jaeger"]
3986+
3987+
otel:
3988+
# otl collector endpoint that the driver will use to send spans.
3989+
# CLI flag: -tracing.otel.oltp-endpoint
3990+
[oltp_endpoint: <string> | default = ""]
3991+
3992+
# Disables client transport security for the exporter.
3993+
# CLI flag: -tracing.otel.insecure
3994+
[insecure: <boolean> | default = false]
3995+
3996+
# enhance/modify traces/propagators for specific exporter. If empty, OTEL
3997+
# defaults will apply. Supported values are: `awsxray.`
3998+
# CLI flag: -tracing.otel.exporter-type
3999+
[exporter_type: <string> | default = ""]
4000+
4001+
# Fraction of traces to be sampled. Fractions >= 1 means sampling if off and
4002+
# everything is traced.
4003+
# CLI flag: -tracing.otel.sample-ration
4004+
[sample_ratio: <float> | default = 0.001]
4005+
```

docs/guides/tracing.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ weight: 10
55
slug: tracing
66
---
77

8-
Cortex uses [Jaeger](https://www.jaegertracing.io/) to implement distributed
9-
tracing. We have found Jaeger invaluable for troubleshooting the behavior of
8+
Cortex uses [Jaeger](https://www.jaegertracing.io/) or [OpenTelemetry](https://opentelemetry.io/) to implement distributed
9+
tracing. We have found tracing invaluable for troubleshooting the behavior of
1010
Cortex in production.
1111

12-
## Dependencies
12+
## Jaeger
13+
14+
### Dependencies
1315

1416
In order to send traces you will need to set up a Jaeger deployment. A
1517
deployment includes either the jaeger all-in-one binary, or else a distributed
1618
system of agents, collectors, and queriers. If running on Kubernetes, [Jaeger
1719
Kubernetes](https://github.com/jaegertracing/jaeger-kubernetes) is an excellent
1820
resource.
1921

20-
## Configuration
22+
### Configuration
2123

2224
In order to configure Cortex to send traces you must do two things:
2325
1. Set the `JAEGER_AGENT_HOST` environment variable in all components to point
@@ -38,3 +40,25 @@ for the full list of environment variables you can configure.
3840
Note that you must specify one of `JAEGER_AGENT_HOST` or
3941
`JAEGER_SAMPLER_MANAGER_HOST_PORT` in each component for Jaeger to be enabled,
4042
even if you plan to use the default values.
43+
44+
45+
## OpenTelemetry
46+
47+
### Dependencies
48+
49+
In order to send traces you will need to set up an OpenTelemetry Collector. The collector will be able to send traces to
50+
multiple destinations such [AWS X-Ray](https://aws-otel.github.io/docs/getting-started/x-ray),
51+
[Google Cloud](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/googlecloudexporter),
52+
[DataDog](https://docs.datadoghq.com/tracing/trace_collection/open_standards/otel_collector_datadog_exporter/) and
53+
[others](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter). OpenTelemetry Collector
54+
provides a [helm chart](https://github.com/open-telemetry/opentelemetry-helm-charts/tree/main/charts/opentelemetry-collector/examples/deployment-otlp-traces)
55+
to set up the environment.
56+
57+
### Configuration
58+
59+
See document on the tracing section in [Configuration file](https://cortexmetrics.io/docs/configuration/configuration-file/).
60+
61+
### Current State
62+
63+
Cortex is maintaining backward compatibility with Jaeger support, Cortex has not fully migrated from OpenTracing to OpenTelemetry and is currently using the
64+
[OpenTracing bridge](https://opentelemetry.io/docs/migration/opentracing/).

go.mod

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,20 @@ require (
4747
github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e
4848
github.com/sony/gobreaker v0.4.1
4949
github.com/spf13/afero v1.6.0
50-
github.com/stretchr/testify v1.7.2
50+
github.com/stretchr/testify v1.8.0
5151
github.com/thanos-io/thanos v0.27.0-rc.0.0.20220715025542-84880ea6d7f8
5252
github.com/uber/jaeger-client-go v2.30.0+incompatible
5353
github.com/weaveworks/common v0.0.0-20210913144402-035033b78a78
5454
go.etcd.io/etcd/api/v3 v3.5.4
5555
go.etcd.io/etcd/client/pkg/v3 v3.5.4
5656
go.etcd.io/etcd/client/v3 v3.5.4
57+
go.opentelemetry.io/contrib/propagators/aws v1.9.0
58+
go.opentelemetry.io/otel v1.9.0
59+
go.opentelemetry.io/otel/bridge/opentracing v1.9.1-0.20220818174925-b9adb171b08e
60+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.9.0
61+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.9.0
62+
go.opentelemetry.io/otel/sdk v1.9.0
63+
go.opentelemetry.io/otel/trace v1.9.0
5764
go.uber.org/atomic v1.9.0
5865
golang.org/x/net v0.0.0-20220607020251-c690dde0001d
5966
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f

go.sum

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,7 @@ github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2V
973973
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
974974
github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
975975
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
976+
github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=
976977
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
977978
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
978979
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -1171,8 +1172,10 @@ github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqC
11711172
github.com/grpc-ecosystem/grpc-gateway v1.14.4/go.mod h1:6CwZWGDSPRJidgKAtJVvND6soZe6fT7iteq8wDPdhb0=
11721173
github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw=
11731174
github.com/grpc-ecosystem/grpc-gateway v1.15.0/go.mod h1:vO11I9oWA+KsxmfFQPhLnnIb1VDE24M+pdxZFiuZcA8=
1175+
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
11741176
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
11751177
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
1178+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.2 h1:ERKrevVTnCw3Wu4I3mtR15QU3gtWy86cBo6De0jEohg=
11761179
github.com/grpc-ecosystem/grpc-gateway/v2 v2.10.2/go.mod h1:chrfS3YoLAlKTRE5cFWvCbt8uGAjshktT4PveTUpsFQ=
11771180
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
11781181
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4=
@@ -1979,8 +1982,9 @@ github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e/go.mod h1:qNTQ5P5J
19791982
github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
19801983
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
19811984
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
1982-
github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
19831985
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
1986+
github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=
1987+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
19841988
github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
19851989
github.com/stretchr/testify v0.0.0-20180303142811-b89eecf5ca5d/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
19861990
github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
@@ -1991,8 +1995,9 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
19911995
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
19921996
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
19931997
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
1994-
github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s=
19951998
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
1999+
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
2000+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
19962001
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
19972002
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
19982003
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
@@ -2188,6 +2193,8 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:
21882193
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.24.0/go.mod h1:7W3JSDYTtH3qKKHrS1fMiwLtK7iZFLPq1+7htfspX/E=
21892194
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0 h1:mac9BKRqwaX6zxHPDe3pvmWpwuuIM0vuXv2juCnQevE=
21902195
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.32.0/go.mod h1:5eCOqeGphOyz6TsY3ZDNjE33SM/TFAK3RGuCL2naTgY=
2196+
go.opentelemetry.io/contrib/propagators/aws v1.9.0 h1:60BnkzNPdU3WD12oOGQNTjgbyws8iDggIaBWpghvcVo=
2197+
go.opentelemetry.io/contrib/propagators/aws v1.9.0/go.mod h1:lYGAfTJZU1mo92QxtuiuNJjRyRyEWj1ldO1b0Vpc1I0=
21912198
go.opentelemetry.io/contrib/propagators/ot v1.4.0 h1:sHp8P5+xmMORvsgKjIPPX4U97JUgSqY4xPWa6ncF1PA=
21922199
go.opentelemetry.io/contrib/propagators/ot v1.4.0/go.mod h1:FivzsGJqC7ND++UUOifWfkiuEOFXtVQ3fh2ZkqIJ9X4=
21932200
go.opentelemetry.io/otel v0.11.0/go.mod h1:G8UCk+KooF2HLkgo8RHX9epABH/aRGYET7gQOqBVdB0=
@@ -2198,17 +2205,26 @@ go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M
21982205
go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs=
21992206
go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk=
22002207
go.opentelemetry.io/otel v1.5.0/go.mod h1:Jm/m+rNp/z0eqJc74H7LPwQ3G87qkU/AnnAydAjSAHk=
2201-
go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM=
22022208
go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk=
2203-
go.opentelemetry.io/otel/bridge/opentracing v1.5.0 h1:fOaCCGOLhDRea4Hv+P+Z8d4JtPEf3SSuNJFT4diV5v8=
2209+
go.opentelemetry.io/otel v1.9.0 h1:8WZNQFIB2a71LnANS9JeyidJKKGOOremcUtb/OtHISw=
2210+
go.opentelemetry.io/otel v1.9.0/go.mod h1:np4EoPGzoPs3O67xUVNoPPcmSvsfOxNlNA4F4AC+0Eo=
22042211
go.opentelemetry.io/otel/bridge/opentracing v1.5.0/go.mod h1:Pci42D1Wz/eZzWeKwGPgqu89bQeak3DdIeZhzGNFu8s=
2212+
go.opentelemetry.io/otel/bridge/opentracing v1.9.1-0.20220818174925-b9adb171b08e h1:hgC49nFXF2+UwDXfb04q/Hno92phgnpMbrSPFNBLrPo=
2213+
go.opentelemetry.io/otel/bridge/opentracing v1.9.1-0.20220818174925-b9adb171b08e/go.mod h1:QYKRAmt+MWDoudzsVKYSutcVs9scYhc2K6YspGV/LLw=
2214+
go.opentelemetry.io/otel/exporters/otlp v0.20.0 h1:PTNgq9MRmQqqJY0REVbZFvwkYOA85vbdQU/nVfxDyqg=
22052215
go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM=
22062216
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4=
22072217
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0/go.mod h1:M1hVZHNxcbkAlcvrOMlpQ4YOO3Awf+4N2dxkZL3xm04=
2218+
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.9.0 h1:ggqApEjDKczicksfvZUCxuvoyDmR6Sbm56LwiK8DVR0=
2219+
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.9.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY=
22082220
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0/go.mod h1:hO1KLR7jcKaDDKDkvI9dP/FIhpmna5lkqPUQdEjFAM8=
22092221
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.7.0/go.mod h1:ceUgdyfNv4h4gLxHR0WNfDiiVmZFodZhZSbOLhpxqXE=
2222+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.9.0 h1:NN90Cuna0CnBg8YNu1Q0V35i2E8LDByFOwHRCq/ZP9I=
2223+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.9.0/go.mod h1:0EsCXjZAiiZGnLdEUXM9YjCKuuLZMYyglh2QDXcYKVA=
22102224
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0/go.mod h1:keUU7UfnwWTWpJ+FWnyqmogPa82nuU5VUANFq49hlMY=
22112225
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.7.0/go.mod h1:E+/KKhwOSw8yoPxSSuUHG6vKppkvhN+S1Jc7Nib3k3o=
2226+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.9.0 h1:M0/hqGuJBLeIEu20f89H74RGtqV2dn+SFWEz9ATAAwY=
2227+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.9.0/go.mod h1:K5G92gbtCrYJ0mn6zj9Pst7YFsDFuvSYEhYKRMcufnM=
22122228
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0/go.mod h1:QNX1aly8ehqqX1LEa6YniTU7VY9I6R3X/oPxhGdTceE=
22132229
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.7.0/go.mod h1:aFXT9Ng2seM9eizF+LfKiyPBGy8xIZKwhusC1gIu3hA=
22142230
go.opentelemetry.io/otel/internal/metric v0.23.0/go.mod h1:z+RPiDJe30YnCrOhFGivwBS+DU1JU/PiLKkk4re2DNY=
@@ -2221,8 +2237,9 @@ go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m
22212237
go.opentelemetry.io/otel/sdk v1.0.1/go.mod h1:HrdXne+BiwsOHYYkBE5ysIcv2bvdZstxzmCQhxTcZkI=
22222238
go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs=
22232239
go.opentelemetry.io/otel/sdk v1.5.0/go.mod h1:CU4J1v+7iEljnm1G14QjdFWOXUyYLHVh0Lh+/BTYyFg=
2224-
go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0=
22252240
go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU=
2241+
go.opentelemetry.io/otel/sdk v1.9.0 h1:LNXp1vrr83fNXTHgU8eO89mhzxb/bbWAsHG6fNf3qWo=
2242+
go.opentelemetry.io/otel/sdk v1.9.0/go.mod h1:AEZc8nt5bd2F7BC24J5R0mrjYnpEgYHyTcM/vrSple4=
22262243
go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE=
22272244
go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE=
22282245
go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw=
@@ -2232,11 +2249,14 @@ go.opentelemetry.io/otel/trace v1.0.1/go.mod h1:5g4i4fKLaX2BQpSBsxw8YYcgKpMMSW3x
22322249
go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk=
22332250
go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE=
22342251
go.opentelemetry.io/otel/trace v1.5.0/go.mod h1:sq55kfhjXYr1zVSyexg0w1mpa03AYXR5eyTkB9NPPdE=
2235-
go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o=
22362252
go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU=
2253+
go.opentelemetry.io/otel/trace v1.9.0 h1:oZaCNJUjWcg60VXWee8lJKlqhPbXAPB51URuR47pQYc=
2254+
go.opentelemetry.io/otel/trace v1.9.0/go.mod h1:2737Q0MuG8q1uILYm2YYVkAyLtOofiTNGg6VODnOiPo=
22372255
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
22382256
go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ=
22392257
go.opentelemetry.io/proto/otlp v0.16.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
2258+
go.opentelemetry.io/proto/otlp v0.18.0 h1:W5hyXNComRa23tGpKwG+FRAc4rfF6ZUg1JReK+QHS80=
2259+
go.opentelemetry.io/proto/otlp v0.18.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
22402260
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
22412261
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
22422262
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=

pkg/alertmanager/distributor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func (d *Distributor) doQuorum(userID string, w http.ResponseWriter, r *http.Req
181181
grpcHeaders := httpToHttpgrpcHeaders(r.Header)
182182
err = ring.DoBatch(r.Context(), RingOp, d.alertmanagerRing, []uint32{shardByUser(userID)}, func(am ring.InstanceDesc, _ []int) error {
183183
// Use a background context to make sure all alertmanagers get the request even if we return early.
184-
localCtx := user.InjectOrgID(context.Background(), userID)
184+
localCtx := opentracing.ContextWithSpan(user.InjectOrgID(context.Background(), userID), opentracing.SpanFromContext(r.Context()))
185185
sp, localCtx := opentracing.StartSpanFromContext(localCtx, "Distributor.doQuorum")
186186
defer sp.Finish()
187187

0 commit comments

Comments
 (0)