-
Notifications
You must be signed in to change notification settings - Fork 4
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
Base docker-compose #2
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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 |
---|---|---|
|
@@ -17,3 +17,5 @@ k6 | |
|
||
# Dependency directories (remove the comment below to include it) | ||
vendor/ | ||
|
||
.golangci.yml |
This file contains 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,50 @@ | ||
version: '3.8' | ||
|
||
networks: | ||
k6: | ||
|
||
services: | ||
prometheus: | ||
image: prom/prometheus:v2.52.0 | ||
command: | ||
- --web.enable-remote-write-receiver | ||
- --enable-feature=native-histograms | ||
- --config.file=/etc/prometheus/prometheus.yml | ||
networks: | ||
- k6 | ||
ports: | ||
- "9090:9090" | ||
|
||
alloy: | ||
image: grafana/alloy:v1.0.0 | ||
networks: | ||
- k6 | ||
volumes: | ||
- ./grafana/alloy:/etc/alloy | ||
environment: | ||
REMOTE_WRITE_HOST: prometheus:9090 | ||
depends_on: | ||
- prometheus | ||
command: | ||
- run | ||
- /etc/alloy/config.alloy | ||
- --storage.path=/var/lib/alloy/data | ||
- --server.http.listen-addr=0.0.0.0:12345 | ||
- --stability.level=experimental # Enable all functionality | ||
ports: | ||
- "12345:12345" # Alloy UI | ||
- "4317:4317" # gRPC receiver | ||
- "4318:4318" # HTTP receiver | ||
|
||
grafana: | ||
image: grafana/grafana:10.1.2 | ||
networks: | ||
- k6 | ||
ports: | ||
- "3000:3000" | ||
environment: | ||
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin | ||
- GF_AUTH_ANONYMOUS_ENABLED=true | ||
- GF_AUTH_BASIC_ENABLED=false | ||
volumes: | ||
- ./grafana:/etc/grafana/provisioning/ |
This file contains 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,44 @@ | ||
// expose OTEL receivers | ||
// https://grafana.com/docs/alloy/latest/reference/components/otelcol.receiver.otlp/ | ||
otelcol.receiver.otlp "default" { | ||
// configures the default gRPC receiver endpoint "0.0.0.0:4317" | ||
// https://grafana.com/docs/alloy/latest/reference/components/otelcol.receiver.otlp/#grpc-block | ||
grpc {} | ||
|
||
// configures the default HTTP receiver endpoint "0.0.0.0:4318" | ||
// https://grafana.com/docs/alloy/latest/reference/components/otelcol.receiver.otlp/#http-block | ||
http {} | ||
|
||
output { | ||
metrics = [otelcol.processor.batch.default.input] | ||
} | ||
} | ||
|
||
otelcol.processor.batch "default" { | ||
// https://grafana.com/docs/alloy/latest/reference/components/otelcol.processor.batch/ | ||
output { | ||
metrics = [otelcol.exporter.prometheus.default.input] | ||
} | ||
} | ||
|
||
otelcol.exporter.prometheus "default" { | ||
add_metric_suffixes = false | ||
forward_to = [prometheus.remote_write.default.receiver] | ||
} | ||
|
||
// Collect metrics from the local running Alloy instance and forward to | ||
// Prometheus. | ||
prometheus.exporter.self "alloy" {} | ||
prometheus.scrape "alloy" { | ||
targets = prometheus.exporter.self.alloy.targets | ||
forward_to = [prometheus.remote_write.default.receiver] | ||
} | ||
|
||
prometheus.remote_write "default" { | ||
endpoint { | ||
url = format( | ||
"http://%s/api/v1/write", | ||
coalesce(env("REMOTE_WRITE_HOST"), "localhost:9090"), | ||
) | ||
} | ||
} |
This file contains 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 @@ | ||
# For configuration options, see | ||
# https://grafana.com/docs/grafana/latest/administration/provisioning/#dashboards | ||
|
||
apiVersion: 1 | ||
|
||
providers: | ||
# We're defining a directory from which to load file-based dashboards | ||
- name: 'prometheus' | ||
type: file | ||
disableDeletion: false | ||
updateIntervalSeconds: 10 | ||
editable: true | ||
options: | ||
path: /etc/grafana/provisioning/dashboards |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is a specific reason for using it over the OTLP receiver built-in in Prometheus then it would be good to comment about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really! I also wanted to try alloy, but I could investigate the following PRs using Prometheus. I will merge as is and open the follow-up task.