-
Notifications
You must be signed in to change notification settings - Fork 211
OpenTelemetry integration #699
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
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
63b1fca
added initial config for prometheus integration in opal server
psardana cff9251
Merge branch 'master' into prometheus_integration
psardana d1ac117
feat(data_update_publisher.py): add data_update_latency metric to tra…
psardana dcdbbf7
Merge branch 'prometheus_integration' of github-personal:psardana/opa…
psardana faf0cd8
refactor(api.py, data_update_publisher.py): update import paths for m…
psardana bc06d6b
feat(data_update_publisher.py): add data_update_count_per_topic metri…
psardana 6dfb25d
feat(metrics): add new metrics for policy updates and bundle requests…
psardana af89d39
moved prometheus metrics to opal common
psardana 6e50055
scopes and security prometheus metrics added
psardana f44e2bb
added client metrics endpoint and total active clients metric
psardana 00830eb
data topic subscribed by client
psardana 192a255
added token type in prometheus metric
psardana bd32ddb
added labels to the metrics for data and policy updates
psardana a6f39b9
added labels in token requests generations and errors
psardana 699e9da
8000
added more labels for prometheus metrics for scope
psardana 140bac3
added metrics for opal client
psardana fa0937e
Merge branch 'master' into prometheus_integration
psardana e6a1096
Merge branch 'master' into prometheus_integration
psardana 1cb9ccf
added docker compose example with prometheus
psardana 5a9bfbb
Merge branch 'master' into prometheus_integration
psardana e1fec7e
fixed metric labels
psardana 035755d
Merge branch 'master' into prometheus_integration
psardana 78ef777
added documentation
psardana 8a57392
Merge branch 'master' into prometheus_integration
psardana 5bde819
added open telemetry traces and metrics
psardana 81e989a
added metrics and traces in documentation
psardana d197fe8
added scope id as an attribute
psardana f63beb6
renamed docker compose
psardana 52e3114
fixed how span is being used
psardana 2db0782
added documentation
psardana 837780e
fixed descriptions
psardana 61fd24c
removed top level code and protected metrics end point
psardana 7f2fab0
fixes for tracing spans
psardana 191cebf
fix metrics end point
psardana ea0c770
fixed docker compose and removed logging exporter from otel
psardana 6f07718
Merge branch 'master' into prometheus_integration
psardana bf897dc
Merge branch 'master' into prometheus_integration
danyi1212 4b24dc0
Fixed pre-commit
danyi1212 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
services: | ||
broadcast_channel: | ||
image: postgres:alpine | ||
environment: | ||
- POSTGRES_DB=postgres | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_PASSWORD=postgres | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
|
||
otel-collector: | ||
image: otel/opentelemetry-collector-contrib:0.114.0 | ||
volumes: | ||
- ./docker_files/otel-collector-config.yaml:/etc/otelcol/config.yaml | ||
command: ["--config", "/etc/otelcol/config.yaml"] | ||
ports: | ||
- "4317:4317" | ||
- "8888:8888" | ||
networks: | ||
- opal-network | ||
|
||
prometheus: | ||
image: prom/prometheus:v2.45.0 | ||
volumes: | ||
- ./docker_files/prometheus.yml:/etc/prometheus/prometheus.yml | ||
- prometheus_data:/prometheus | ||
ports: | ||
- "9090:9090" | ||
command: | ||
- '--config.file=/etc/prometheus/prometheus.yml' | ||
- '--storage.tsdb.path=/prometheus' | ||
- '--web.console.libraries=/etc/prometheus/console_libraries' | ||
- '--web.console.templates=/etc/prometheus/consoles' | ||
- '--web.enable-lifecycle' | ||
networks: | ||
- opal-network | ||
depends_on: | ||
- otel-collector | ||
|
||
grafana: | ||
image: grafana/grafana:9.5.3 | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- grafana_data:/var/lib/grafana | ||
environment: | ||
- GF_SECURITY_ADMIN_PASSWORD=admin | ||
- GF_USERS_ALLOW_SIGN_UP=false | ||
depends_on: | ||
- prometheus | ||
networks: | ||
- opal-network | ||
|
||
opal_server: | ||
image: permitio/opal-server:latest | ||
environment: | ||
- OPAL_BROADCAST_URI=postgres://postgres:postgres@broadcast_channel:5432/postgres | ||
- UVICORN_NUM_WORKERS=4 | ||
- OPAL_POLICY_REPO_URL=https://github.com/permitio/opal-example-policy-repo | ||
- OPAL_POLICY_REPO_POLLING_INTERVAL=30 | ||
- OPAL_DATA_CONFIG_SOURCES={"config":{"entries":[{"url":"http://opal_server:7002/policy-data","topics":["policy_data"],"dst_path":"/static"}]}} | ||
- OPAL_LOG_FORMAT_INCLUDE_PID=true | ||
- OPAL_ENABLE_OPENTELEMETRY_TRACING=true | ||
- OPAL_ENABLE_OPENTELEMETRY_METRICS=true | ||
- OPAL_OPENTELEMETRY_OTLP_ENDPOINT="otel-collector:4317" | ||
ports: | ||
- "7002:7002" | ||
depends_on: | ||
- broadcast_channel | ||
- otel-collector | ||
networks: | ||
- opal-network | ||
|
||
opal_client: | ||
image: permitio/opal-client:latest | ||
environment: | ||
- OPAL_SERVER_URL=http://opal_server:7002 | ||
- OPAL_LOG_FORMAT_INCLUDE_PID=true | ||
- OPAL_INLINE_OPA_LOG_FORMAT=http | ||
ports: | ||
- "7766:7000" | ||
- "8181:8181" | ||
depends_on: | ||
- opal_server | ||
- otel-collector | ||
command: sh -c "exec ./wait-for.sh opal_server:7002 --timeout=20 -- ./start.sh" | ||
networks: | ||
- opal-network | ||
|
||
networks: | ||
opal-network: | ||
driver: bridge | ||
volumes: | ||
postgres_data: | ||
prometheus_data: | ||
grafana_data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
endpoint: 0.0.0.0:4317 | ||
|
||
exporters: | ||
prometheus: | ||
endpoint: "0.0.0.0:8888" | ||
debug: | ||
verbosity: detailed | ||
|
||
processors: | ||
batch: | ||
|
||
service: | ||
pipelines: | ||
traces: | ||
receivers: [otlp] | ||
processors: [batch] | ||
exporters: [debug] | ||
metrics: | ||
receivers: [otlp] | ||
processors: [batch] | ||
exporters: [prometheus] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
global: | ||
AE27 | scrape_interval: 15s | |
evaluation_interval: 15s | ||
|
||
scrape_configs: | ||
- job_name: 'opal_server' | ||
static_configs: | ||
- targets: ['opal_server:7002'] | ||
metrics_path: '/metrics' | ||
|
||
- job_name: 'opal_client' | ||
static_configs: | ||
- targets: ['opal_client:7000'] | ||
metrics_path: '/metrics' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.