Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyyy09 committed Aug 9, 2024
2 parents f665c96 + a6ccf56 commit 53b8eb7
Show file tree
Hide file tree
Showing 22 changed files with 785 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
codecov:
notify:
require_ci_to_pass: yes
after_n_builds: 11
after_n_builds: 19
strict_yaml_branch: main # only use the latest copy on the main branch

ignore:
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/ci-docker-all-in-one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ jobs:
mode:
- name: v1
binary: all-in-one
skip_sampling: false
- name: v2
binary: jaeger
skip_sampling: true

steps:
- name: Harden Runner
Expand Down Expand Up @@ -61,7 +59,7 @@ jobs:
run: |
case ${GITHUB_EVENT_NAME} in
pull_request)
echo "BUILD_FLAGS=-l -D -p linux/amd64" >> ${GITHUB_ENV}
echo "BUILD_FLAGS=-l -D -p linux/$(go env GOARCH)" >> ${GITHUB_ENV}
;;
*)
echo "BUILD_FLAGS=" >> ${GITHUB_ENV}
Expand All @@ -76,5 +74,3 @@ jobs:
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
# SKIP_SAMPLING is used by integration tests, see https://github.com/jaegertracing/jaeger/issues/5531
SKIP_SAMPLING: ${{ matrix.mode.skip_sampling }}
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,52 @@ run `make changelog` to generate content

</details>

1.60.0 (2024-08-06)
-------------------

### Backend Changes

#### ⛔ Breaking Changes

* Completely remove "grpc-plugin" as storage type ([@yurishkuro](https://github.com/yurishkuro) in [#5741](https://github.com/jaegertracing/jaeger/pull/5741))

#### 🐞 Bug fixes, Minor Improvements

* Do not use image tag without version ([@yurishkuro](https://github.com/yurishkuro) in [#5783](https://github.com/jaegertracing/jaeger/pull/5783))
* Only attach :latest tag to versioned images from main ([@yurishkuro](https://github.com/yurishkuro) in [#5781](https://github.com/jaegertracing/jaeger/pull/5781))
* Add references to jaeger v2 ([@yurishkuro](https://github.com/yurishkuro) in [#5779](https://github.com/jaegertracing/jaeger/pull/5779))
* Ensure hotrod image is published at the end of e2e test ([@yurishkuro](https://github.com/yurishkuro) in [#5764](https://github.com/jaegertracing/jaeger/pull/5764))
* [bug] [hotrod] delay env var mapping until logger is initialized ([@yurishkuro](https://github.com/yurishkuro) in [#5760](https://github.com/jaegertracing/jaeger/pull/5760))
* Make otlp receiver listen on all ips again ([@yurishkuro](https://github.com/yurishkuro) in [#5739](https://github.com/jaegertracing/jaeger/pull/5739))
* [hotrod] fix connectivity in docker compose ([@yurishkuro](https://github.com/yurishkuro) in [#5734](https://github.com/jaegertracing/jaeger/pull/5734))

#### 🚧 Experimental Features

* [v2] enable remote sampling extension and include in e2e tests ([@yurishkuro](https://github.com/yurishkuro) in [#5802](https://github.com/jaegertracing/jaeger/pull/5802))
* Ensure similar naming for storage write metrics ([@Wise-Wizard](https://github.com/Wise-Wizard) in [#5798](https://github.com/jaegertracing/jaeger/pull/5798))
* [v2] ensure similar naming for query service metrics ([@Wise-Wizard](https://github.com/Wise-Wizard) in [#5785](https://github.com/jaegertracing/jaeger/pull/5785))
* Configure otel collector to observe internal telemetry ([@Wise-Wizard](https://github.com/Wise-Wizard) in [#5752](https://github.com/jaegertracing/jaeger/pull/5752))
* Add kafka exporter and receiver configuration ([@joeyyy09](https://github.com/joeyyy09) in [#5703](https://github.com/jaegertracing/jaeger/pull/5703))
* Enable spm in jaeger v2 ([@FlamingSaint](https://github.com/FlamingSaint) in [#5681](https://github.com/jaegertracing/jaeger/pull/5681))
* [jaeger-v2] add `remotesampling` extension ([@Pushkarm029](https://github.com/Pushkarm029) in [#5389](https://github.com/jaegertracing/jaeger/pull/5389))
* Created telset for remote-storage component ([@Wise-Wizard](https://github.com/Wise-Wizard) in [#5731](https://github.com/jaegertracing/jaeger/pull/5731))

#### 👷 CI Improvements

* Unpin codeql actions ([@yurishkuro](https://github.com/yurishkuro) in [#5787](https://github.com/jaegertracing/jaeger/pull/5787))
* Skip building hotrod for all platforms for pull requests ([@Manoramsharma](https://github.com/Manoramsharma) in [#5765](https://github.com/jaegertracing/jaeger/pull/5765))
* Add a threshold for expected zero values in the spm script ([@FlamingSaint](https://github.com/FlamingSaint) in [#5753](https://github.com/jaegertracing/jaeger/pull/5753))
* [v2] add e2e test with memory store ([@yurishkuro](https://github.com/yurishkuro) in [#5751](https://github.com/jaegertracing/jaeger/pull/5751))
* Rationalize naming of gha workflow files ([@yurishkuro](https://github.com/yurishkuro) in [#5750](https://github.com/jaegertracing/jaeger/pull/5750))


### 📊 UI Changes

#### 🐞 Bug fixes, Minor Improvements

* Allow uploading json-per-line otlp data ([@BenzeneAlcohol](https://github.com/BenzeneAlcohol) in [#2380](https://github.com/jaegertracing/jaeger-ui/pull/2380))


1.59.0 (2024-07-10)
-------------------

Expand Down
5 changes: 3 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* A curated list of notable changes and links to PRs. Do not simply dump git log, select the changes that affect the users.
To obtain the list of all changes run `make changelog` or use `scripts/release-notes.py`.
* The section can be split into sub-section if necessary, e.g. UI Changes, Backend Changes, Bug Fixes, etc.
* If the jaeger-ui submodule has changes cut a new release and also upgrade the submodule versions then commit, for example:
* If the jaeger-ui submodule has changes cut a new release
* Then upgrade the submodule versions and finally commit. For example:
```
git submodule init
git submodule update
Expand Down Expand Up @@ -60,8 +61,8 @@ Here are the release managers for future versions with the tentative release dat

| Version | Release Manager | Tentative release date |
|---------|-----------------|------------------------|
| 1.60.0 | @jkowall | 7 August 2024 |
| 1.61.0 | @yurishkuro | 3 September 2024 |
| 1.62.0 | @albertteoh | 2 October 2024 |
| 1.63.0 | @pavolloffay | 5 November 2024 |
| 1.64.0 | @joe-elliott | 4 December 2024 |
| 1.65.0 | @jkowall | 8 January 2025 |
10 changes: 5 additions & 5 deletions cmd/all-in-one/all_in_one_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ func getAPITrace(t *testing.T) {
}

func getSamplingStrategy(t *testing.T) {
// TODO once jaeger-v2 can pass this test, remove from .github/workflows/ci-all-in-one-build.yml
if os.Getenv("SKIP_SAMPLING") == "true" {
t.Skip("skipping sampling strategy check because SKIP_SAMPLING=true is set")
}
_, body := httpGet(t, agentAddr+getSamplingStrategyURL)
// TODO should we test refreshing the strategy file?

r, body := httpGet(t, agentAddr+getSamplingStrategyURL)
t.Logf("Sampling strategy response: %s", string(body))
require.EqualValues(t, http.StatusOK, r.StatusCode)

var queryResponse api_v2.SamplingStrategyResponse
require.NoError(t, jsonpb.Unmarshal(bytes.NewReader(body), &queryResponse))
Expand Down
32 changes: 18 additions & 14 deletions cmd/jaeger/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ARG base_image
ARG debug_image

# ------------- Begin PROD image -------------

FROM $base_image AS release
ARG TARGETARCH
ARG USER_UID=10001
Expand All @@ -14,9 +16,12 @@ EXPOSE 6831/udp
# Agent jaeger.thrift binary
EXPOSE 6832/udp

# Agent config HTTP
# Sampling config HTTP
EXPOSE 5778

# Sampling config gRPC
EXPOSE 5779

# Collector OTLP gRPC
EXPOSE 4317

Expand All @@ -35,16 +40,15 @@ EXPOSE 9411
# Web HTTP
EXPOSE 16686

# Default configuration file for setting sampling strategies
# ENV SAMPLING_STRATEGIES_FILE=/etc/jaeger/sampling_strategies.json
# COPY sampling_strategies.json /etc/jaeger/

COPY jaeger-linux-$TARGETARCH /go/bin/jaeger-linux
COPY jaeger-linux-$TARGETARCH /cmd/jaeger/jaeger-linux
COPY sampling-strategies.json /cmd/jaeger/sampling-strategies.json

VOLUME ["/tmp"]
ENTRYPOINT ["/go/bin/jaeger-linux"]
ENTRYPOINT ["/cmd/jaeger/jaeger-linux"]
USER ${USER_UID}

# ------------- Begin DEBUG image -------------

FROM $debug_image AS debug
ARG TARGETARCH=amd64
ARG USER_UID=10001
Expand All @@ -58,9 +62,12 @@ EXPOSE 6831/udp
# Agent jaeger.thrift binary
EXPOSE 6832/udp

# Agent config HTTP
# Sampling config HTTP
EXPOSE 5778

# Sampling config gRPC
EXPOSE 5779

# Collector OTLP gRPC
EXPOSE 4317

Expand All @@ -82,12 +89,9 @@ EXPOSE 16686
# Delve
EXPOSE 12345

# Default configuration file for setting sampling strategies
# ENV SAMPLING_STRATEGIES_FILE=/etc/jaeger/sampling_strategies.json
# COPY sampling_strategies.json /etc/jaeger/

COPY jaeger-debug-linux-$TARGETARCH /go/bin/jaeger-linux
COPY jaeger-debug-linux-$TARGETARCH /cmd/jaeger/jaeger-linux
COPY sampling-strategies.json /cmd/jaeger/sampling-strategies.json

VOLUME ["/tmp"]
ENTRYPOINT ["/go/bin/dlv", "exec", "/go/bin/jaeger-linux", "--headless", "--listen=:12345", "--api-version=2", "--accept-multiclient", "--log", "--"]
ENTRYPOINT ["/go/bin/dlv", "exec", "/cmd/jaeger/jaeger-linux", "--headless", "--listen=:12345", "--api-version=2", "--accept-multiclient", "--log", "--"]
USER ${USER_UID}
14 changes: 12 additions & 2 deletions cmd/jaeger/internal/all-in-one.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
service:
extensions: [jaeger_storage, jaeger_query]
extensions: [jaeger_storage, jaeger_query, remote_sampling]
pipelines:
traces:
receivers: [otlp, jaeger, zipkin]
Expand All @@ -12,7 +12,7 @@ service:
level: detailed
address: 0.0.0.0:8888
# TODO Initialize telemetery tracer once OTEL released new feature.
# https://github.com/open-telemetry/opentelemetry-collector/issues/10663
# https://github.com/open-telemetry/opentelemetry-collector/issues/10663

extensions:
jaeger_query:
Expand All @@ -24,6 +24,16 @@ extensions:
memory:
max_traces: 100000

remote_sampling:
# We can either use file or adaptive sampling strategy in remote_sampling
file:
path: ./cmd/jaeger/sampling-strategies.json
# adaptive:
# sampling_store: some_store
# initial_sampling_probability: 0.1
http:
grpc:

receivers:
otlp:
protocols:
Expand Down
7 changes: 6 additions & 1 deletion cmd/jaeger/internal/extension/remotesampling/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,12 @@ func (ext *rsExtension) startHTTPServer(ctx context.Context, host component.Host
SamplingProvider: ext.strategyProvider,
},
MetricsFactory: metrics.NullFactory,
BasePath: "/api", // TODO is /api correct?

// In v1 the sampling endpoint in the collector was at /api/sampling, because
// the collector reused the same port for multiple services. In v2, the extension
// always uses a separate port, making /api prefix unnecessary. So we mimic the behavior
// of jaeger-agent port 5778 which serves sampling strategies at /sampling endpoint.
BasePath: "",
})
httpMux := http.NewServeMux()
handler.RegisterRoutesWithHTTP(httpMux)
Expand Down
4 changes: 2 additions & 2 deletions cmd/jaeger/internal/extension/remotesampling/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ func NewFactory() extension.Factory {
func createDefaultConfig() component.Config {
return &Config{
HTTP: &confighttp.ServerConfig{
Endpoint: ports.PortToHostPort(ports.CollectorHTTP + 100),
Endpoint: ports.PortToHostPort(ports.AgentConfigServerHTTP),
},
GRPC: &configgrpc.ServerConfig{
NetAddr: confignet.AddrConfig{
Endpoint: ports.PortToHostPort(ports.CollectorGRPC + 100),
Endpoint: ports.PortToHostPort(ports.AgentConfigServerHTTP + 1),
Transport: confignet.TransportTypeTCP,
},
},
Expand Down
4 changes: 2 additions & 2 deletions cmd/jaeger/sampling-strategies.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"default_strategy": {
"type": "probabilistic",
"param": 0.1
"param": 1
},
"service_strategies": [
{
Expand All @@ -12,7 +12,7 @@
{
"service": "bar",
"type": "ratelimiting",
"param": 1
"param": 0.9
}
]
}
4 changes: 2 additions & 2 deletions docker/debug/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.5-alpine AS build
FROM golang:1.22.6-alpine AS build
ARG TARGETARCH
ENV GOPATH /go
RUN apk add --update --no-cache ca-certificates make git build-base mailcap
Expand All @@ -10,7 +10,7 @@ RUN if [[ "$TARGETARCH" == "s390x" || "$TARGETARCH" == "ppc64le" ]] ; then \
go install github.com/go-delve/delve/cmd/dlv@latest; \
fi

FROM golang:1.22.5-alpine
FROM golang:1.22.6-alpine
COPY --from=build /go/bin/dlv /go/bin/dlv
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/mime.types /etc/mime.types
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ require (
go.uber.org/automaxprocs v1.5.3
go.uber.org/goleak v1.3.0
go.uber.org/zap v1.27.0
golang.org/x/net v0.27.0
golang.org/x/sys v0.22.0
golang.org/x/net v0.28.0
golang.org/x/sys v0.23.0
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.2
gopkg.in/yaml.v3 v3.0.1
Expand Down Expand Up @@ -226,9 +226,9 @@ require (
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/text v0.17.0 // indirect
gonum.org/v1/gonum v0.15.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
Expand Down
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,8 @@ golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30=
golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M=
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -745,8 +745,8 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
Expand All @@ -756,8 +756,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -782,21 +782,21 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk=
golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=
golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=
golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
9 changes: 8 additions & 1 deletion internal/metrics/otelmetrics/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewFactory(meterProvider metric.MeterProvider) metrics.Factory {
}

func (f *otelFactory) Counter(opts metrics.Options) metrics.Counter {
name := f.subScope(opts.Name)
name := CounterNamingConvention(f.subScope(opts.Name))
counter, err := f.meter.Int64Counter(name)
if err != nil {
log.Printf("Error creating OTEL counter: %v", err)
Expand Down Expand Up @@ -131,3 +131,10 @@ func attributeSetOption(tags map[string]string) metric.MeasurementOption {
}
return metric.WithAttributes(attributes...)
}

func CounterNamingConvention(name string) string {
if !strings.HasSuffix(name, "_total") {
name += "_total"
}
return name
}
Loading

0 comments on commit 53b8eb7

Please sign in to comment.