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

[backend] Introducing profiling capability with pyroscope #9469

Merged
merged 12 commits into from
Jan 7, 2025

Conversation

richard-julien
Copy link
Member

@richard-julien richard-julien commented Dec 27, 2024

PR Contains multiple subjects

Split between tracing and metrics graphql plugins.

We now have a dedicated plugin for metrics including a refactor to have an histogram for latency operations
Previously it was required to also activate tracing, that doesnt make sens.

Rework of ingestion manager logs

The ingestion manager currently log errors that doest not help. First step is to move logs to warn. The second step will be to catch and display a ingester status in the UI.

We need to have a way to profile CPU usage in the application.

This PR introduce pyroscope tooling based on datadog-pprof.
As pprof required some prebuilts executable, dockerfile needs to be modified to add specific prebuilt files.
Dynamic require is use instead of import to prevent importing all the tooling if not needed.

To test the behavior, you need:

Linux

The current pyroscope implementation is not working on windows even if the binary exists.
grafana/pyroscope-nodejs#87
grafana/pyroscope-nodejs#85

Deployment

  opencti-pyroscope:
    container_name: opencti-pyroscope
    image: grafana/pyroscope
    restart: unless-stopped
    ports:
      - "4040:4040"

OpenCTI configuration

      - APP__TELEMETRY__PYROSCOPE__ENABLED=true
      - APP__TELEMETRY__PYROSCOPE__IDENTIFIER=opencti-profiling-node01
      - APP__TELEMETRY__PYROSCOPE__EXPORTER=http://opencti-pyroscope:4040
image

@github-actions github-actions bot added the filigran team use to identify PR from the Filigran team label Dec 27, 2024
@richard-julien richard-julien changed the title [bakend] Introduce profiling capability with pyroscope [bakend] Introducing profiling capability with pyroscope Dec 27, 2024
@richard-julien richard-julien changed the title [bakend] Introducing profiling capability with pyroscope [backend] Introducing profiling capability with pyroscope Dec 27, 2024
Copy link

codecov bot commented Dec 27, 2024

Codecov Report

Attention: Patch coverage is 4.08163% with 94 lines in your changes missing coverage. Please review.

Project coverage is 65.15%. Comparing base (608aef8) to head (abb83ad).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
...tform/opencti-graphql/src/graphql/tracingPlugin.js 0.00% 54 Missing ⚠️
...ti-platform/opencti-graphql/src/instrumentation.js 0.00% 17 Missing ⚠️
...orm/opencti-graphql/src/graphql/telemetryPlugin.js 0.00% 7 Missing ⚠️
...ti-platform/opencti-graphql/src/graphql/graphql.js 0.00% 5 Missing ⚠️
...rm/opencti-graphql/src/manager/ingestionManager.ts 0.00% 5 Missing ⚠️
opencti-platform/opencti-graphql/src/back.js 0.00% 2 Missing ⚠️
...-platform/opencti-graphql/src/http/httpPlatform.js 0.00% 2 Missing ⚠️
...cti-platform/opencti-graphql/src/config/tracing.ts 80.00% 1 Missing ⚠️
...latform/opencti-graphql/src/manager/taskManager.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9469      +/-   ##
==========================================
- Coverage   65.15%   65.15%   -0.01%     
==========================================
  Files         628      630       +2     
  Lines       60037    60093      +56     
  Branches     6693     6732      +39     
==========================================
+ Hits        39117    39151      +34     
- Misses      20920    20942      +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@richard-julien richard-julien force-pushed the oob/profiling branch 2 times, most recently from ec65ac8 to d3a10fc Compare January 3, 2025 19:28
@richard-julien richard-julien merged commit 29dded4 into master Jan 7, 2025
8 of 9 checks passed
@richard-julien richard-julien deleted the oob/profiling branch January 7, 2025 14:56
@nino-filigran nino-filigran linked an issue Jan 8, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filigran team use to identify PR from the Filigran team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

500 error in the logs
1 participant