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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

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.21053% with 91 lines in your changes missing coverage. Please review.

Project coverage is 65.16%. Comparing base (a5affd2) to head (d3a10fc).

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 ⚠️
...cti-platform/opencti-graphql/src/config/tracing.ts 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9469      +/-   ##
==========================================
- Coverage   65.19%   65.16%   -0.04%     
==========================================
  Files         628      630       +2     
  Lines       59961    59999      +38     
  Branches     6687     6693       +6     
==========================================
+ Hits        39091    39097       +6     
- Misses      20870    20902      +32     

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

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.

1 participant