Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CON-284] Add OpenTelemetry tracing for express and bunyan #3630

Closed
wants to merge 4 commits into from

Conversation

jonaylor89
Copy link
Contributor

Description

This PR adds the OpenTelemetry sdk to content node as well as several instrumentations

  • Express (and http)
  • Bunyan
  • Redis
  • Postgres

which provide trace data to content node. This PR does not add an exporter for traces so the only noticable change with this PR is the additional of trace data in bunyan logs. I'll follow up with more PRs to add an exporter(s) (e.g. Jaegar) as well as instrumentation for bull queues to get trace data in the processors there.

{
  "name": "audius_creator_node",
  "hostname": "bfe4e3ec8309",
  "pid": 5791,
  "level": 30,
  "msg": "AHHHHHHHHHH",
  "time": "2022-08-04T03:57:56.495Z",
  "v": 0,
  "trace_id": "06d7347e5e24235afdafdf4a2bad5310",
  "span_id": "cc07f4f1f5bfb525",
  "trace_flags": "01",
  "resource.span": {
    "attributes": {
      "http.url": "http://127.0.0.1:3000/prometheus_metrics",
      "http.host": "127.0.0.1:3000",
      "net.host.name": "127.0.0.1",
      "http.method": "GET",
      "http.client_ip": "172.22.0.10",
      "http.target": "/prometheus_metrics",
      "http.user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.134 Safari/537.36",
      "http.flavor": "1.0",
      "net.transport": "ip_tcp"
    },
    "links": [],
    "events": [],
    "status": {
      "code": 0
    },
    "endTime": [
      0,
      0
    ],
    "_ended": false,
    "_duration": [
      -1,
      -1
    ],
    "name": "GET /prometheus_metrics",
    "_spanContext": {
      "traceId": "06d7347e5e24235afdafdf4a2bad5310",
      "spanId": "cc07f4f1f5bfb525",
      "traceFlags": 1
    },
    "kind": 1,
    "startTime": [
      1659585476,
      492679321
    ],
    "resource": {
      "attributes": {
        "service.name": "content-node-server",
        "telemetry.sdk.language": "nodejs",
        "telemetry.sdk.name": "opentelemetry",
        "telemetry.sdk.version": "1.5.0"
      }
    },
    "instrumentationLibrary": {
      "name": "@opentelemetry/instrumentation-http",
      "version": "0.31.0"
    },
    "_spanLimits": {
      "attributeValueLengthLimit": null,
      "attributeCountLimit": 128,
      "linkCountLimit": 128,
      "eventCountLimit": 128
    },
    "_spanProcessor": {},
    "_attributeValueLengthLimit": null
  },
  "resource.service.name": "content-node-server",
  "logLevel": "info"
}

Tests

This was tested by adding some test logs to content node routes, pinging routes like /health_check and /prometheus_metrics, and observing the log data exported.

Monitoring - How will this change be monitored? Are there sufficient logs / alerts?

These changes will add a new label on logs that can be filtered for in loggly (traceid, spanid)

@jonaylor89 jonaylor89 requested a review from SidSethi August 4, 2022 04:10
@jonaylor89 jonaylor89 changed the title [CON-248] Add OpenTelemetry tracing for express and bunyan [CON-284] Add OpenTelemetry tracing for express and bunyan Aug 4, 2022
@SidSethi
Copy link
Contributor

SidSethi commented Aug 4, 2022

i see this is in draft but you've tagged reviewers - do you want me to do a review?
also CN tests failing

@jonaylor89
Copy link
Contributor Author

i see this is in draft but you've tagged reviewers - do you want me to do a review? also CN tests failing

Ya, it's still a draft. I'm still adding finishing touches to stuff and didn't mean to ping y'all.

Also, the tests are failing because of tracer.ts being typescript so it should just be a build/lint fix

@jonaylor89 jonaylor89 removed the request for review from SidSethi August 5, 2022 21:39
@pull-request-size pull-request-size bot added size/L and removed size/M labels Aug 5, 2022
@jonaylor89 jonaylor89 closed this Aug 16, 2022
@stereosteve stereosteve deleted the jn-con-284 branch March 29, 2023 15:09
sliptype pushed a commit that referenced this pull request Sep 10, 2023
Co-authored-by: Nikki Kang <kangaroo233@gmail.com>
sliptype pushed a commit that referenced this pull request Sep 10, 2023
[fe5fda4] Fix entity button widths (#3650) Dylan Jeffers
[820e79e] Fix user profile always showing artist tabs (#3648) Dylan Jeffers
[bc34b6f] [C-2697] Fix mobile playlist qa issues (#3638) Dylan Jeffers
[3e8d7e8] Mobile chats recalculate container bottom on keyboard shown (#3644) Reed
[39928cf] Bump app versions for full release (#3643) Reed
[437e971] Update SDK to v3.0.3-beta.56 (#3641) Marcus Pasell
[3e42cb2] [PAY-1526] Mobile chat reaction picker shadow (#3642) Reed
[ab33206] Amplitude tracking for chat report abuse (#3639) Reed
[6f570c6] Put playlist-artwork generation behind flag (#3640) Dylan Jeffers
[2f1f40d] [C-2475] Add desktop favorites playlist tab (#3637) Dylan Jeffers
[394cacb] [PAY-1516] Chat report abuse flow (#3636) Reed
[82204ec] [C-2763] Fix desktop playlist qa issues (#3634) Dylan Jeffers
[3912407] Implement OAuth Write Popup C-2664 (#3628) nicoback2
[7e13b54] [C-2783] Add terms of service link (#3635) Dylan Jeffers
[bda6eeb] Refactor: extract reusable modal field component (#3631) Andrew Mendelsohn
[c2a59dc] [PAY-1319] Fix emoji keyboard overlapping chat text input (#3629) Reed
[14150ec] [C-2784] Refactor track page to use entity button (#3624) Dylan Jeffers
[5a3e74e] [PAY-1457] Add amplitude analytics to chat features (#3627) Marcus Pasell
[d1aee10] [PAY-1412] Reset player state on app load (#3632) Reed
[965330c] [PAY-1191] Finesse keyboard enter/exit animations (#3633) Michael Piazza
[c9c531e] Create grant upon making developer app (#3630) nicoback2
[a33de30] [PAY-1464] DMs: Go to chat after successful tip (#3625) Marcus Pasell
[646a5eb] [PLAT-1015] Remove entity manager feature flag (#3619) Raymond Jacobson
[31450e7] [PAY-1498][PAY-1477] Misc mobile DMs UI Fixes (#3626) Michael Piazza
[a08f3e7] [C-2760, C-2779] Fix header for playlist and artists tabs in explore screen (#3579) Kyle Shanks
[9a98157] [C-2676] Rough release date modal (#3610) Andrew Mendelsohn
[5e9a847] [C-2771, C-2772] Add duplicate add to playlist confirmation drawer and modal (#3601) Kyle Shanks
[49ca553] [PAY-1468] Fix mobile chats copy message button (#3623) Reed
[193ae1c] [PAY-1483] Patch RN to fix textinput multiline onchange not firing (#3622) Reed
@AudiusProject AudiusProject deleted a comment from linear bot Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants