-
Hello 👋 We are trying to understand what is the expected way to integrate Opentelemetry into our project for the following objective:
BeforePreviously we were able to successfully export traces only by using javaagent lazy val otelVersion = "1.6.0"
...
val compileDependencies: Seq[ModuleID] = Seq(
"io.opentelemetry" % "opentelemetry-api" % otelVersion,
"io.opentelemetry" % "opentelemetry-exporter-otlp" % otelVersion,
"io.opentelemetry" % "opentelemetry-extension-annotations" % otelVersion,
"io.opentelemetry" % "opentelemetry-sdk" % otelVersion,
"io.opentelemetry.instrumentation" % "opentelemetry-logback-1.0" % "1.4.1-alpha", The way we obtained def getTracer: Tracer = GlobalOpenTelemetry.getTracer(serviceName) Recently...we set as a goal to switch on metrics through opentelemetry as well. We've updated our dependencies (including the agent) as described here and we set-up our LastlyAs the outcome of the discussion from the last link we've removed non def getMeter: OtelMeter = GlobalOpenTelemetry.getMeter(serviceName) Unfortunately now we cannot even see our metrics in the collector at all. That seems to be in line with what the documentation says:
IssueTogether with the previous two discussions (linked in this thread) I find this confusing. I would like to understand what dependencies, versions and configurations we need to get to our objective. Do we need to rely on The collector yaml file that I use for local investigation is below. receivers:
otlp/receiver:
protocols:
grpc:
http:
processors:
batch:
timeout: 10s
memory_limiter:
check_interval: 1s
limit_mib: 200
spike_limit_mib: 100
exporters:
otlp/elastic:
endpoint: apm-server:8200
tls:
insecure: true
logging:
loglevel: debug
service:
pipelines:
traces:
receivers: [otlp/receiver]
processors: [memory_limiter,batch]
exporters: [otlp/elastic]
metrics:
receivers: [otlp/receiver]
processors: [memory_limiter,batch]
exporters: [otlp/elastic, logging] I use opentelemetry-collector version |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 15 replies
-
If you're using the agent, it will automatically configure an If your application has additional instrumentation and needs to access the In terms of which dependencies you need, since SDK configuration is happening in the agent, you should only need to depend on If you're using version |
Beta Was this translation helpful? Give feedback.
-
While metrics has been alpha, we don't enable it by default so you may just be missing |
Beta Was this translation helpful? Give feedback.
If you're using the agent, it will automatically configure an
OpenTelemetry
instance using the autoconfigure module. All of the configuration properties used by autoconfigure can be used with the agent. If those options are for some reason insufficient, there are a variety of extension options available.If your application has additional instrumentation and needs to access the
OpenTelemetry
instance, it can do so by callingGlobalOpenTelemetry.get()
. Its recommended to only callGlobalOpenTelemetry.get()
once and use the result to initialize any application components that are dependent on it. Your application should not configure a separate instance ofOpenTelemetry
and set it globally …