Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    akash19980
    @akash19980
    Can anyone help me with integrating AWS-XRAY with OTEL with a sample Example
    3 replies
    akash19980
    @akash19980
    This message was deleted
    1 reply
    akash19980
    @akash19980
    How can I use Elastic Search as a backend for Zipkin ?
    1 reply
    Raghavendra Sai
    @scumpah

    Hey everyone, I got a simple use case. I wanna send logs from node-app to collector and export those logs to loki. I managed to integrate collector with loki exporter using this -> https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/lokiexporter/example

    So now I am trying to read logs from oltp as receiver through http endpoint (instead of fluent forward/fluentd) and export them to loki. After going through docs I found out that otel log format is required, couldn't find any references on how to send logs from node-app in the official documentation

    There are npm packages for tracing and metrics, can the same be used for sending logs to otlp and will they work the same to export logs to loki? Thoughts on what to do here?

    P.S I checked https://opentelemetry.io/docs/js/ and there's no mention/references on sending logs.

    2 replies
    Jakub Malinowski
    @jtmalinowski
    Fix for opentelemetry.io docs, appreciated if someone from OTel JS approvers can stamp it open-telemetry/opentelemetry.io#512
    hettothecool
    @hettothecool
    Hi Everyone, I don't need any help with an issue, but I wanted to show how I got past an issue I hit before using opentelemetry version v0.19.0. I've got two servicesboth written in golang that communicate using a bi-directional gRPC stream and I wanted to have context propagation between the services in order to display the span traces for requests between the services in Tempo. Unfortunately, it looks like you cannot do context propagation with a bi-directional gRPC stream, so I had to resort to setting the Trace Id on each proto sent between the services. Once a service receives a proto with a Trace Id, I needed to build a context and set the Trace Id on it. This code snippet is what I used to create a new Span that eventually got displayed on Tempo. Hope this is useful to somone
    2 replies
    image.png
    Rolfjdra
    @Rolfjdra

    Hi everyone. I want to reuse the traceId through some async processes in our architecture. (One use case is that we have a scheduler that we call to create jobs that will run at set times)
    I am doing this by storing the traceId manually and picking it back up.

    In nodejs:

    1. How can I re-use this traceId when starting a span?
    2. How can I set this context as active? (Our log factory is getting traceId/spanId from active context)

    I have made this work in golang (the same way as "hettothecool" in the post above), but can't find a way to do it in nodejs.
    Thanks in advance!

    1 reply
    Jordan Sinko
    @JordanSinko
    Anyone having issues with Xray Id Generator creating non unique trace ids? I am seeing some of my traces grouping 4-5 traces that should have their own id. We arent carrying through the parent context, so the root id is always generated
    1 reply
    bbehnke
    @bbehnke

    In my jest testing I am running into this error

    TypeError: Cannot read property 'INFO' of undefined
     1 | import { SimpleSpanProcessor } from "@opentelemetry/tracing";
            | ^
          2 | import { WebTracerProvider } from "@opentelemetry/web";
          3 | import { trace } from "@opentelemetry/api";
          4 | import IntuitTraceExporter from "../../../src/utils/trace/IntuitTraceExporter";
    
          at Object.<anonymous> (node_modules/@opentelemetry/core/src/utils/environment.ts:101:32)
          at Object.<anonymous> (node_modules/@opentelemetry/core/src/platform/node/environment.ts:18:1)
          at Object.<anonymous> (node_modules/@opentelemetry/core/src/platform/node/index.ts:17:1)
          at Object.<anonymous> (node_modules/@opentelemetry/core/src/platform/index.ts:16:1)
          at Object.<anonymous> (node_modules/@opentelemetry/core/src/common/time.ts:18:1)
          at Object.<anonymous> (node_modules/@opentelemetry/core/src/index.ts:20:1)
          at Object.<anonymous> (node_modules/@opentelemetry/tracing/src/Tracer.ts:18:1)
          at Object.<anonymous> (node_modules/@opentelemetry/tracing/src/index.ts:17:1)
          at Object.<anonymous> (test/utils/trace/IntuitTraceActionHandler.test.js:1:1)

    I don't see it in actual runtime, only in the unit tests. Any ideas?

    1 reply
    Dharin Shah
    @Dharin-shah
    hi, can someone please help me with this issue
    open-telemetry/opentelemetry-js#2235, new to typescript
    Dharin Shah
    @Dharin-shah

    hi, can someone please help me with this issue
    open-telemetry/opentelemetry-js#2235, new to typescript

    Resolved :)

    Dharin Shah
    @Dharin-shah
    question : will the http instrumentation registration work after the server is started ?
    Delaney
    @delaneyj

    I having a real hard time tried to get distributed traces working with 0.19 (haven't tried previous). Have two node services A,B. In this case A calls B. I can get traces showing up in Jaegar for both A and B but not as a single trace. Looking at the headers in B I don't see any trace related ones.

    per the examples I could find A looks like

    const serviceName = 'A'
      const provider = new NodeTracerProvider()
      registerInstrumentations({
        tracerProvider: provider,
        instrumentations: [new HttpInstrumentation()],
      })
    
      provider.register()
    
      const consoleExporter = new ConsoleSpanExporter()
      const spanProcessor = new SimpleSpanProcessor(consoleExporter)
      provider.addSpanProcessor(spanProcessor)
    
      const jaegerExporter = new JaegerExporter({
        serviceName,
        host: 'localhost',
      })
      const zipkinProcessor = new SimpleSpanProcessor(jaegerExporter)
      provider.addSpanProcessor(zipkinProcessor)
    
      const tracer = trace.getTracer(serviceName)

    from what I can gather it should be hooking directly into the http module. Since A calls B via node-fetch, (which uses http) this should get auto propagated correct?

    3 replies
    deepak khetwal
    @deepakkhetwal
    What's the best way to propagate tracing between services communicated through message broker like kafka. Can someone share code or advise, how that can be implemented
    I tried passing span context and retrieved at other end and added it to span created, but getting error context.value is not a function
    akash19980
    @akash19980
    image.png
    3 replies
    Can some one help me with this error
    mel000vin@yahoo.com
    @melvincheng:matrix.org
    [m]
    hi guys, anyone encountered this ? was following the otel nodejs getting-started, however not sure why my service.name always ended up as unknown_service even though i have specifically indicated serviceName:"getting-started" inside the tracking.js file
    1 reply
    deepak khetwal
    @deepakkhetwal
    @dyladan I am having trouble in setting up trace between two azure functions producing and consuming using keda(kafka trigger). Do you have sample code to set up trace between kafka producer and consumer, can't use kafkajs as instrumentation library for context propagation and maintain trace between these two, as Azure functions are handling producing and consuming messages through their wrapper internally.
    akash19980
    @akash19980
    {"stack":"Error: 14 UNAVAILABLE: No connection established\n    at Object.callErrorFromStatus (D:\\Users\\akashdeep\\Desktop\\Examples\\sampleTracing\\node_modules\\@grpc\\grpc-js\\build\\src\\call.js:31:26)\n
    Getting this error while using it whenever I hit the endpoint.... I get the traces in the
    console but this error is also there\
    https://github.com/aws-observability/aws-otel-js/tree/main/sample-apps
    Pier-Luc Gagnon
    @pierlucg-xs
    How do you create child spans now? I see a lot of documentation saying something like
    const childSpan = tracer.startSpan('foo', {parent: bar}); // but parent is not in SpanOptions
    // or
    const childSpan = tracer.withSpan(...); // this is not a method on tracer
    Anupam Dalmia
    @anupamdalmia10

    Hi

    I am using this extension for instrumenting in the browser: https://github.com/svrnm/opentelemetry-browser-extension/

    It is using opentelemetry for web, I wanted to know if there is any way to pass on the info of traces generated by this extension with the actual web request to backend.

    One way I can think of is using chrome.WebRequest API but wanted to know if the library itself gives any option to do so.

    Svetlana Brennan
    @svetlanabrennan

    Is there a way to add custom header to be attached to each span in one trace? I'm trying to tie a frontend session to a trace but I want the frontend session ID to be attached to every span in that trace. Right now I can only attach a frontend session ID by setting it as an attribute on the first span.

    "use strict";
    const PORT = process.env.PORT || "8080";
    
    const { trace, context } = require('@opentelemetry/api')
    
    const express = require("express");
    const axios = require("axios");
    const app = express();
    
    app.get("/", (req, res) => { 
      let headers = req.headers;
      let sessionURL = headers["sessionurl"];
      let currentSpan = trace.getSpan(context.active());
      currentSpan.setAttribute("frontendSession", sessionURL);
      axios
        .get(`http://localhost:${PORT}/middle-tier`)
        .then(() => axios.get(`http://localhost:${PORT}/middle-tier`))
        .then((result) => {
          res.send(result.data);
        })
        .catch((err) => {
          console.error(err);
          res.status(500).send();
        });
    });

    The tracing.js file looks like this:

    "use strict";
    const { NodeTracerProvider } = require("@opentelemetry/node");
    
    const { diag, DiagConsoleLogger, DiagLogLevel } = require("@opentelemetry/api");
    const { registerInstrumentations } = require("@opentelemetry/instrumentation");
    const { HttpInstrumentation } = require("@opentelemetry/instrumentation-http");
    const { GrpcInstrumentation } = require("@opentelemetry/instrumentation-grpc");
    
    const { Resource } = require("@opentelemetry/resources");
    const { ResourceAttributes } = require("@opentelemetry/semantic-conventions");
    const { SimpleSpanProcessor } = require("@opentelemetry/tracing");
    const { ZipkinExporter } = require("@opentelemetry/exporter-zipkin");
    
    const provider = new NodeTracerProvider({});
    
    diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.ALL);
    
    provider.addSpanProcessor(new SimpleSpanProcessor(new ZipkinExporter({})));
    
    provider.register()
    
    registerInstrumentations({
      instrumentations: [new HttpInstrumentation(), new GrpcInstrumentation()],
    });
    
    console.log("tracing initialized :)");

    Here's a screenshot of the trace in Zipkin: https://www.screencast.com/t/qnKakEzNym

    And here's the package.json file:
      "dependencies": {
        "@opentelemetry/api": "^0.21.0",
        "@opentelemetry/core": "^0.21.0",
        "@opentelemetry/exporter-prometheus": "^0.21.0",
        "@opentelemetry/exporter-zipkin": "^0.21.0",
        "@opentelemetry/instrumentation-express": "^0.22.0",
        "@opentelemetry/instrumentation-grpc": "^0.21.0",
        "@opentelemetry/instrumentation-http": "^0.21.0",
        "@opentelemetry/metrics": "^0.21.0",
        "@opentelemetry/node": "^0.21.0",
        "@opentelemetry/tracing": "^0.21.0",
        "axios": "^0.21.0",
        "express": "^4.17.1"
      }
    Jason Kuhrt
    @jasonkuhrt
    Can someone point me to docs for adding OT to node+lambda?
    Raja Moola Mahadevan
    @mmraja83
    image.png
    Hi, I have been trying to setup Otl for Javascript (Angular) application. Everything works fine. But it is showing "unknown service " in the zipkin after the trace. Does anyone know how to mention the service name ?
    Konig-Corey
    @Konig-Corey
    Can someone PLEASE point me to where/how I can configure additional attributes/labels on metrics being consumed by the host metric receiver in the otel agent configuration and being exported with the awsemf exporter? I have not been able to successfully apply additional attributes/dimensions and this seems like a rudimentary feature so I must just be doing it wrong.
    Anupam Dalmia
    @anupamdalmia10
    11 replies
    Aritra Das
    @dev-aritra

    Using lightstep-opentelemetry-launcher-node
    When I use the public sattelite spans are received correctly on the dashboard.
    But as soon as I put my private satellite it stops receiving spans.
    My private satellite is reachable from the host machine.

    Satellite Status
    ✓ ready / healthy
    ✓ alive
    ✓ configuration parsed

    Satellite staus also shows ok.
    Can someone tell what could be wrong?

    akash19980
    @akash19980
    new WinstonInstrumentation({
            // Optional hook to insert additional context to log metadata.
            // Called after trace context is injected to metadata.
            logHook: (record, span) => {
              record['resource.service.name'] =
                provider.resource.attributes['service.name'];
            },
          }),

    Im trying top instrument winston in my application. then logging inside this example function

    const winston = require('winston');
    const logger = winston.createLogger({
      transports: [new winston.transports.Console()],
    });
    export async function nExample() {
      const span = track.startSpan('spanStarted', {
        attributes: {
          'code.function': 'Example Function',
        },
      });
      logger.info('zbc');
      for (var i = 0; i < 10; i++) {
        await console.log('Span is started');
      }
      span.end();

    But im not able to see trace id and spanid in the log. Can anyone suggest me the solution or if i am doing something wrong or am i missing something

    Konig-Corey
    @Konig-Corey

    Has anyone seen this error when trying to write to Amazon Managed Prometheus

    2021-08-26T19:17:41.683Z    error    exporterhelper/queued_retry.go:288    Exporting failed. The error is not retryable. Dropping data.    {"kind": "exporter", "name": "awsprometheusremotewrite", "error": "Permanent error: [Permanent error: invalid temporality and type combination; Permanent error: invalid temporality and type combination; Permanent error: invalid temporality and type combination]", "dropped_items": 66}

    The error doesn't really make much sense to me and I can't seem to find any instances of others having the same issue. Thoughts?

    Konig-Corey
    @Konig-Corey
    Opened a bug ticket about prometheus writter. Any input would be greatly apprecaited: open-telemetry/opentelemetry-collector-contrib#4909
    Ivan Pukhtin
    @StreetStrider
    I need my child span to be in child_process. How can I pass context to subprocesses?
    Pranay Prateek
    @pranay01_twitter
    ➜  otlp-exporter-node git:(main) ✗ npm install
    npm ERR! code E404
    npm ERR! 404 Not Found - GET https://registry.npmjs.org/@opentelemetry%2fexporter-otlp-grpc - Not found
    npm ERR! 404 
    npm ERR! 404  '@opentelemetry/exporter-otlp-grpc@0.25.0' is not in the npm registry.
    npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
    npm ERR! 404 
    npm ERR! 404 Note that you can also install from a
    npm ERR! 404 tarball, folder, http url, or git url.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/pranay/.npm/_logs/2021-10-04T14_15_50_188Z-debug.log

    It seems the required packages are not in npm registry yet

    how to solve this?

    Richard W
    @RichardWright
    Is this the best place to ask questions about the design of the nodejs metrics client? \
    I've given up trying to get the UpDown counter to function like a gauge, I think (correct me if I'm wrong) but the createUpDownSumObserver behaves like a gauge should - as in the value can be set, not just what it should increment/decrement by.
    is there a way to use this without hard coding the callback? I'm trying not to spread the state of an rxjs observable outside of it, but without the 'observe' function working, this is sort of impossible.
    kpreeti2588
    @kpreeti2588
    Nest
    vanseverk
    @vanseverk
    Hi guys, we have a large number of nodejs applications that we want to be able to get traces and metrics from in a product-agnostic way, and to get that information to Datadog. This is why we have been looking into opentelemetry. It currently already puts the required trace IDs on our logs, but right now we are also trying to get those traces to Datadog. This is on EKS where we have a Datadog agent running in a Daemonset. I found that there's an exporter https://github.com/Datadog/dd-opentelemetry-exporter-js but that is marked as deprecated - despite being referenced as an integration possibility in the Datadog documentation. Does that mean we would be forced to set up this OTEL collector to feed the Datadog agent? We would definitely prefer not to go that path, as it would require extra setup
    Omkar Kirpan
    @OmkarKirpan

    We are trying to integrate opentelemetry in our microservices with istio. we are facing an integration issue since istio is creating and forwarding x-b3 headers which open telemetry is not expecting. Opentelemetry is not able to extract spans created by istio in x-b3-header.

    Are there any guides for implementing open-telemetry in an istio environment?

    Or-Zarchi-Forter
    @Or-Zarchi-Forter
    As been asked before by @svetlanabrennan, when tracing an incoming http request, is there a way to attach a http header as an attribute to all future child spans created in the context of the request?
    In other words, is there a way to customize the context automatically created by HttpInstrumentation by adding more context fields? That way I can automatically propagate said fields to all subsequent spans (maybe by writing a custom span processor)
    Some vendors like honeycomb that leverage OT call it Multi span attributes
    I haven't been able to achieve it with the node SDK
    5 replies
    Konig-Corey
    @Konig-Corey
    Is it expected that that OTEL instrumentation in go does not also publish metrics related to published traces? Previously in datadog when a trace was published it also automatically published metrics related to the trace. (E.i http.request.hits with a count of requests, as well as the endpoint and response code of that request). Is this something that has to be manually instrumented? This seems like an easy win and most people would want metrics generated from traces as well.
    Brad Frost
    @bradfrosty
    Hello, I'm trying to debug why multiple spans are created when using the user interaction plugin (open-telemetry/opentelemetry-js-contrib#548). Looking at the instrumentation code, I'm wondering what the purpose is for the _incrementTask() method. This is always 1 (initial increment), even when the event target is the same. Under what scenarios would this be greater than 1?
    2 replies
    Konig-Corey
    @Konig-Corey
    Does anyone have a solution to getting automatic metrics generated from traces? This is something that datadog seemed to do out of the box and was wondering if there are any processors/recievers that will assist in auto generating metrics based off recieved traces?