THIS FORUM IS NO LONGER ACTIVE. Join us on CNCF Slack: https://cloud-native.slack.com/archives/CJFCJHG4Q.
Trying to get open telemetry working for node, but I'm only getting a single span registered: the one I manually execute at the end of startup.
Using Express, Graphql, Redis, Mysql, Node 14.15.1
docker-compose.yml
version: '3.8'
services:
elasticsearch:
container_name: fnb_elasticsearch
image: elasticsearch:7.9.3
tty: true
environment:
- discovery.type=single-node
- network.bind_host=0.0.0.0
volumes:
- ./elastic/db:/usr/share/elasticsearch/data
restart: always
ports:
- "9200:9200/tcp"
- "9300:9300"
collector:
container_name: fnb_opentelemetry_collector
image: otel/opentelemetry-collector:latest
command: ["--config=./conf/collector-config.yaml", "--log-level=DEBUG"]
volumes:
- ./telemetry/collector-config.yaml:/conf/collector-config.yaml
ports:
- "9464:9464"
- "8888:8888" # Prometheus metrics exposed by the collector
- "8889:8889" # Prometheus exporter metrics
- "55680:55680"
- "55681:55681"
depends_on:
- jaeger-collector
jaeger-collector:
container_name: fnb_jaeger_collector
image: jaegertracing/jaeger-opentelemetry-collector:latest
command: [
"--es.num-shards=1",
"--es.num-replicas=0",
"--es.server-urls=http://elasticsearch:9200"
]
environment:
- SPAN_STORAGE_TYPE=elasticsearch
restart: always
ports:
- "14250:14250"
- "14268:14268"
depends_on:
- elasticsearch
jaeger-agent:
container_name: fnb_jaeger_agent
image: jaegertracing/jaeger-opentelemetry-agent:latest
command: [
"--reporter.grpc.host-port=jaeger-collector:14250"
]
volumes:
- ./:/config/:ro
ports:
- "6831:6831/udp"
- "6832:6832/udp"
- "5778:5778"
restart: always
depends_on:
- jaeger-collector
jaeger-query:
container_name: fnb_jaeger_query
image: jaegertracing/jaeger-query:latest
command: [
"--es.num-shards=1",
"--es.num-replicas=0",
"--es.server-urls=http://elasticsearch:9200"
]
environment:
- SPAN_STORAGE_TYPE=elasticsearch
- LOG_LEVEL=debug
- JAEGER_ENDPOINT=http://fnb_jaeger_collector:14268/api/traces
restart: always
ports:
- "16686:16686"
- "16687"
depends_on:
- elasticsearch
tracer.js imported at the top
const opentelemetry = require('@opentelemetry/api').default;
const { GraphQLInstrumentation } = require('@trendhim/opentelemetry-instrumentation-graphql');
const { ConsoleSpanExporter, BatchSpanProcessor } = require('@opentelemetry/tracing');
const { LogLevel } = require('@opentelemetry/core');
const { NodeTracerProvider } = require('@opentelemetry/node');
const { JaegerExporter } = require('@opentelemetry/exporter-jaeger');
const serviceName = 'FNB';
const provider = new NodeTracerProvider({
logLevel: LogLevel.DEBUG,
plugins: {
dns: {
enabled: false,
path: '@opentelemetry/plugin-dns',
},
http: {
enabled: true,
path: '@opentelemetry/plugin-http',
ignoreOutgoingUrls: [
/\/v1\/trace/,
/\/v1\/metrics/,
],
},
https: {
enabled: true,
path: '@opentelemetry/plugin-https',
ignoreOutgoingUrls: [
/\/v1\/trace/,
/\/v1\/metrics/,
],
},
express: { enabled: true, path: '@opentelemetry/plugin-express' },
ioredis: { enabled: true, path: '@opentelemetry/plugin-ioredis' },
mysql: { enabled: true, path: '@opentelemetry/plugin-mysql' },
},
});
const graphQLInstrumentation = new GraphQLInstrumentation({
allowAttributes: true,
depth: 5,
mergeItems: true,
});
graphQLInstrumentation.setTracerProvider(provider);
graphQLInstrumentation.enable();
const exporter = new JaegerExporter({
serviceName,
});
provider.addSpanProcessor(new BatchSpanProcessor(exporter));
provider.addSpanProcessor(new BatchSpanProcessor(new ConsoleSpanExporter()));
provider.register();
Hello,
Would like to understand the telemetry printed on the console,
Does anyone know what is the meaning of each of these fields:
[
{
"SpanContext": {
"TraceID": "1a56f684a2626798c55d7bd5b2febcd0",
"SpanID": "f3562ddd3625c7f0",
"TraceFlags": 1
},
"ParentSpanID": "0000000000000000",
"SpanKind": 2,
"Name": "GoTemplate/RegisterViaEmail",
"StartTime": "2020-12-25T21:10:42.719104+07:00",
"EndTime": "2020-12-25T21:10:42.726077171+07:00",
"Attributes": [
{
"Key": "rpc.system",
"Value": {
"Type": "STRING",
"Value": "grpc"
}
},
{
"Key": "rpc.service",
"Value": {
"Type": "STRING",
"Value": "GoTemplate"
}
},
{
"Key": "rpc.method",
"Value": {
"Type": "STRING",
"Value": "RegisterViaEmail"
}
},
{
"Key": "net.peer.ip",
"Value": {
"Type": "STRING",
"Value": "127.0.0.1"
}
},
{
"Key": "net.peer.port",
"Value": {
"Type": "STRING",
"Value": "50147"
}
},
{
"Key": "rpc.grpc.status_code",
"Value": {
"Type": "UINT32",
"Value": 0
}
}
],
"MessageEvents": [
{
"Name": "message",
"Attributes": [
{
"Key": "message.type",
"Value": {
"Type": "STRING",
"Value": "RECEIVED"
}
},
{
"Key": "message.id",
"Value": {
"Type": "INT64",
"Value": 1
}
},
{
"Key": "message.uncompressed_size",
"Value": {
"Type": "INT64",
"Value": 12
}
}
],
"Time": "2020-12-25T21:10:42.719123+07:00"
},
{
"Name": "message",
"Attributes": [
{
"Key": "message.type",
"Value": {
"Type": "STRING",
"Value": "SENT"
}
},
{
"Key": "message.id",
"Value": {
"Type": "INT64",
"Value": 1
}
},
{
"Key": "message.uncompressed_size",
"Value": {
"Type": "INT64",
"Value": 26
}
}
],
"Time": "2020-12-25T21:10:42.726072+07:00"
}
],
"Links": null,
"StatusCode": "Unset",
"StatusMessage": "",
"HasRemoteParent": false,
"DroppedAttributeCount": 0,
"DroppedMessageEventCount": 0,
"DroppedLinkCount": 0,
"ChildSpanCount": 0,
"Resource": null,
"InstrumentationLibrary": {
"Name": "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc",
"Version": "semver:0.15.1"
}
}
]
I can't seem to find the docs
In opentelemetery-api v0.8.0, we used to set a new SpanContext in current Context via following code:
TracingContextUtils.currentContextWith(DefaultSpan.create(newSpanCtx))
However, in v0.13.1, both - TracingContextUtils and DefaultSpan are removed. Then how can I set a new SpanContext in the current Context?
I'm using JaegerExporter for .Net and all my telemetry is reporting as "OpenTelemetry Exporter" as you may see on this picture on jaeger UI.
What should be set on the telemetry reports or the exporter in order to have the proper service name there?
Thanks!
I'm using JaegerExporter for .Net and all my telemetry is reporting as "OpenTelemetry Exporter" as you may see on this picture on jaeger UI.
What should be set on the telemetry reports or the exporter in order to have the proper service name there?
Thanks!
Just found it, thanks!
Hello,
I was curious as per the standard, are labels meant to be per value or per metric?
As a concrete example, I want all HTTP requests sent from an application to be exposed as two metrics - requests count(as Counter) and latency(as ValueRecorder). The application is sending requests to a verity of 3rd party systems, I want the metric to contain a way to group the request based on DNS name, response code, path and others. Is labels the correct abstraction to allow such grouping or there is something else, better suited?
P.S If this is not the correct place to ask this question, could somebody point me to the correct one?
The @opentelemetry Metrics Workshop happens tomorrow at 9:30 PST at https://zoom.us/j/8203130519
9:30 - 9:45am PST: Opening remarks, organization of the day, how we got here, and the many streams of work. We have an API, language SDKs, a Protocol, a Collector, Receivers, Exporters, Semantic Conventions, and a connection to Tracing [organizer: OTel Committee]
9:45-10:15am PST: Community building: @opentelemetry has first-class @OpenMetricsIO support, and @PrometheusIO users are first-class users. These projects are meant to get along, and committed to it. [organizer: Alolita Sharma]
10:15 - 11:00am PST: @opentelemetry Collector deployment models (e.g., Daemonset vs. Statefulset), Agents, Sidecars, and first-class support for Prometheus Remote-Write [organizer: Jaana Dogan]
11:30 - 12:15pm The Metrics API and Data Model, how we integrated the @opencensusio feature set (Tracing and Metrics, combined!) with the @OpenMetricsIO and StatsD data models. Presenting the six @opentelemetry metric instruments [organizer: Bogdan Drutu]
12:15 - 13:00pm Histograms! How we’ll support high-resolution and variable-boundary histograms and the connection to sampling metric events [organizers: Josh MacDonald, Michael Gerstenhaber]
13:30 - 15:00pm Questions and answers
Hello everyone I had a problem when installing OTEL with istio
I had set b3-propagator as here https://www.npmjs.com/package/@opentelemetry/propagator-b3
and it works but I get a warning in all my spans " invalid parent span IDs "?