Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If a test case fails (let's say `examples/nodejs`), follow these steps:

1. Build a new image: `mise run build-lgtm dev1`
2. `oats -timeout 2h -lgtm-version dev1 examples/nodejs` (automatically installed by `mise`)
3. go to <http://localhost:3000>
3. go to <http://127.0.0.1:3000>

You can run all everything together using `mise run test`.

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ mise run lgtm
You can enable logging for troubleshooting:

| Environment Variable | Enables Logging in: |
| ------------------------ | ----------------------- |
|--------------------------|-------------------------|
| `ENABLE_LOGS_GRAFANA` | Grafana |
| `ENABLE_LOGS_LOKI` | Loki |
| `ENABLE_LOGS_PROMETHEUS` | Prometheus |
Expand Down Expand Up @@ -105,12 +105,12 @@ There's no need to configure anything: the Docker image works with OpenTelemetry
```sh
# Not needed, but these are the defaults in OpenTelemetry
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318
```

## View Grafana

Navigate to <http://localhost:3000> and log in with the default built-in user `admin` and password `admin`.
Navigate to <http://127.0.0.1:3000> and log in with the default built-in user `admin` and password `admin`.

## Build the Docker image from scratch

Expand Down Expand Up @@ -183,12 +183,12 @@ Each example uses a different application port
(to be able to run all applications at the same time).

| Example | Service URL |
| ------- | ------------------------------------- |
| Java | `curl http://localhost:8080/rolldice` |
| Go | `curl http://localhost:8081/rolldice` |
| Python | `curl http://localhost:8082/rolldice` |
| .NET | `curl http://localhost:8083/rolldice` |
| Node.js | `curl http://localhost:8084/rolldice` |
|---------|---------------------------------------|
| Java | `curl http://127.0.0.1:8080/rolldice` |
| Go | `curl http://127.0.0.1:8081/rolldice` |
| Python | `curl http://127.0.0.1:8082/rolldice` |
| .NET | `curl http://127.0.0.1:8083/rolldice` |
| Node.js | `curl http://127.0.0.1:8084/rolldice` |

## Related Work

Expand Down
8 changes: 4 additions & 4 deletions docker/grafana-datasources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ datasources:
- name: Prometheus
type: prometheus
uid: prometheus
url: http://localhost:9090
url: http://127.0.0.1:9090
editable: true
jsonData:
timeInterval: 60s
Expand All @@ -16,7 +16,7 @@ datasources:
- name: Tempo
type: tempo
uid: tempo
url: http://localhost:3200
url: http://127.0.0.1:3200
editable: true
jsonData:
tracesToLogsV2:
Expand All @@ -39,7 +39,7 @@ datasources:
- name: Loki
type: loki
uid: loki
url: http://localhost:3100
url: http://127.0.0.1:3100
editable: true
jsonData:
derivedFields:
Expand All @@ -53,4 +53,4 @@ datasources:
- name: Pyroscope
type: grafana-pyroscope-datasource
uid: pyroscope
url: http://localhost:4040
url: http://127.0.0.1:4040
2 changes: 1 addition & 1 deletion docker/loki-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ schema_config:
period: 24h

ruler:
alertmanager_url: http://localhost:9093
alertmanager_url: http://127.0.0.1:9093

pattern_ingester:
lifecycler:
Expand Down
10 changes: 5 additions & 5 deletions docker/otelcol-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ receivers:
- job_name: "opentelemetry-collector"
scrape_interval: 1s
static_configs:
- targets: ["localhost:8888"]
- targets: ["127.0.0.1:8888"]

extensions:
health_check:
Expand All @@ -26,19 +26,19 @@ processors:

exporters:
otlphttp/metrics:
endpoint: http://localhost:9090/api/v1/otlp
endpoint: http://127.0.0.1:9090/api/v1/otlp
tls:
insecure: true
otlphttp/traces:
endpoint: http://localhost:4418
endpoint: http://127.0.0.1:4418
tls:
insecure: true
otlphttp/logs:
endpoint: http://localhost:3100/otlp
endpoint: http://127.0.0.1:3100/otlp
tls:
insecure: true
otlp/profiles:
endpoint: http://localhost:4040
endpoint: http://127.0.0.1:4040
tls:
insecure: true
debug/metrics:
Expand Down
12 changes: 6 additions & 6 deletions docker/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ declare -A service_ready elapsed_times

# Define services and their health check URLs
declare -A services
services["grafana"]="http://localhost:3000/api/health"
services["loki"]="http://localhost:3100/ready"
services["prometheus"]="http://localhost:9090/api/v1/status/runtimeinfo"
services["tempo"]="http://localhost:3200/ready"
services["pyroscope"]="http://localhost:4040/ready"
services["otelcol"]="http://localhost:13133/ready"
services["grafana"]="http://127.0.0.1:3000/api/health"
services["loki"]="http://127.0.0.1:3100/ready"
services["prometheus"]="http://127.0.0.1:9090/api/v1/status/runtimeinfo"
services["tempo"]="http://127.0.0.1:3200/ready"
services["pyroscope"]="http://127.0.0.1:4040/ready"
services["otelcol"]="http://127.0.0.1:13133/ready"

# Initialize service_ready status to false for all services
for service in "${!services[@]}"; do
Expand Down
8 changes: 4 additions & 4 deletions docker/tempo-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ distributor:
otlp:
protocols:
grpc:
endpoint: "localhost:4417"
endpoint: "127.0.0.1:4417"
http:
endpoint: "localhost:4418"
endpoint: "127.0.0.1:4418"

ingester:
trace_idle_period: 1s
Expand All @@ -25,7 +25,7 @@ ingester:

querier:
frontend_worker:
frontend_address: localhost:9096
frontend_address: 127.0.0.1:9096

storage:
trace:
Expand All @@ -49,7 +49,7 @@ metrics_generator:
storage:
path: /data/tempo/generator/wal
remote_write:
- url: http://localhost:9090/api/v1/write
- url: http://127.0.0.1:9090/api/v1/write
send_exemplars: true

overrides:
Expand Down
2 changes: 1 addition & 1 deletion examples/dotnet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
serviceVersion: typeof(Program).Assembly.GetName().Version?.ToString() ?? "unknown",
serviceInstanceId: Environment.MachineName);

const string DefaultEndpoint = "http://localhost:4317";
const string DefaultEndpoint = "http://127.0.0.1:4317";

// Configure OpenTelemetry tracing and metrics with auto-start using the
// AddOpenTelemetry() extension method from the OpenTelemetry.Extensions.Hosting package.
Expand Down
2 changes: 1 addition & 1 deletion examples/dotnet/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"applicationUrl": "http://localhost:8083/rolldice"
"applicationUrl": "http://127.0.0.1:8083/rolldice"
}
}
}
2 changes: 1 addition & 1 deletion examples/dotnet/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
}
},
"Otlp": {
"Endpoint": "http://localhost:4317"
"Endpoint": "http://127.0.0.1:4317"
}
}
2 changes: 1 addition & 1 deletion examples/ebpf-profiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ Navigate to the [Pyroscope UI][Pyroscope UI] to visualize the profiles.
<!-- editorconfig-checker-disable -->
<!-- markdownlint-disable MD013 -->

[Pyroscope UI]: http://localhost:3000/a/grafana-pyroscope-app/explore?searchText=&panelType=time-series&layout=grid&hideNoData=off&explorationType=flame-graph&var-serviceName=unknown&var-profileMetricId=process_cpu:cpu:nanoseconds:cpu:nanoseconds&var-spanSelector=undefined&var-dataSource=pyroscope&var-filters=&var-filtersBaseline=&var-filtersComparison=&var-groupBy=all&maxNodes=16384
[Pyroscope UI]: http://127.0.0.1:3000/a/grafana-pyroscope-app/explore?searchText=&panelType=time-series&layout=grid&hideNoData=off&explorationType=flame-graph&var-serviceName=unknown&var-profileMetricId=process_cpu:cpu:nanoseconds:cpu:nanoseconds&var-spanSelector=undefined&var-dataSource=pyroscope&var-filters=&var-filtersBaseline=&var-filtersComparison=&var-groupBy=all&maxNodes=16384
2 changes: 1 addition & 1 deletion examples/go/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

export OTEL_METRIC_EXPORT_INTERVAL="5000" # so we don't have to wait 60s for metrics
export OTEL_RESOURCE_ATTRIBUTES="service.name=rolldice,service.instance.id=localhost:8081"
export OTEL_RESOURCE_ATTRIBUTES="service.name=rolldice,service.instance.id=127.0.0.1:8081"

# Run the application
# use http instead of https (needed because of https://github.com/open-telemetry/opentelemetry-go/issues/4834)
Expand Down
2 changes: 1 addition & 1 deletion examples/java/json-logging-ecs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
1. Build the Docker image using using `build.sh`
2. Deploy the manifest using `kubectl apply -f k8s/` (e.g. using [k3d.sh](k3d.sh))
3. Generate traffic using [generate-traffic.sh](../../../generate-traffic.sh)
4. Log in to [http://localhost:3000](http://localhost:3000) with user _admin_ and password _admin_.
4. Log in to [http://127.0.0.1:3000](http://127.0.0.1:3000) with user _admin_ and password _admin_.
5. Go to "Explore"
6. Select "Loki" as data source
8 changes: 4 additions & 4 deletions examples/java/json-logging-ecs/k8s/collector-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ data:
scrape_configs:
- job_name: 'opentelemetry-collector'
static_configs:
- targets: [ 'localhost:8888' ]
- targets: [ '127.0.0.1:8888' ]
filelog/json-ecs:
include:
- /var/log/pods/*/*/*.log
Expand Down Expand Up @@ -136,11 +136,11 @@ data:

exporters:
otlphttp/metrics:
endpoint: http://localhost:9090/api/v1/otlp
endpoint: http://127.0.0.1:9090/api/v1/otlp
otlphttp/traces:
endpoint: http://localhost:4418
endpoint: http://127.0.0.1:4418
otlphttp/logs:
endpoint: http://localhost:3100/otlp
endpoint: http://127.0.0.1:3100/otlp
debug/metrics:
verbosity: detailed
debug/traces:
Expand Down
2 changes: 1 addition & 1 deletion examples/java/json-logging-logback/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
1. Build the Docker image using using `build.sh`
2. Deploy the manifest using `kubectl apply -f k8s/` (e.g. using [k3d.sh](k3d.sh))
3. Generate traffic using [generate-traffic.sh](../../../generate-traffic.sh)
4. Log in to [http://localhost:3000](http://localhost:3000) with user _admin_ and password _admin_.
4. Log in to [http://127.0.0.1:3000](http://127.0.0.1:3000) with user _admin_ and password _admin_.
5. Go to "Explore"
6. Select "Loki" as data source
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ data:
scrape_configs:
- job_name: 'opentelemetry-collector'
static_configs:
- targets: [ 'localhost:8888' ]
- targets: [ '127.0.0.1:8888' ]
filelog/json-logback:
include:
- /var/log/pods/*/*/*.log
Expand Down Expand Up @@ -145,11 +145,11 @@ data:

exporters:
otlphttp/metrics:
endpoint: http://localhost:9090/api/v1/otlp
endpoint: http://127.0.0.1:9090/api/v1/otlp
otlphttp/traces:
endpoint: http://localhost:4418
endpoint: http://127.0.0.1:4418
otlphttp/logs:
endpoint: http://localhost:3100/otlp
endpoint: http://127.0.0.1:3100/otlp
debug/metrics:
verbosity: detailed
debug/traces:
Expand Down
2 changes: 1 addition & 1 deletion examples/java/json-logging-otlp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
1. Build the Docker image using using `build.sh`
2. Deploy the manifest using `kubectl apply -f k8s/` (e.g. using [k3d.sh](k3d.sh))
3. Generate traffic using [generate-traffic.sh](../../../generate-traffic.sh)
4. Log in to [http://localhost:3000](http://localhost:3000) with user _admin_ and password _admin_.
4. Log in to [http://127.0.0.1:3000](http://127.0.0.1:3000) with user _admin_ and password _admin_.
5. Go to "Explore"
6. Select "Loki" as data source
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ data:

exporters:
otlphttp/metrics:
endpoint: http://localhost:9090/api/v1/otlp
endpoint: http://127.0.0.1:9090/api/v1/otlp
otlphttp/traces:
endpoint: http://localhost:4418
endpoint: http://127.0.0.1:4418
otlphttp/logs:
endpoint: http://localhost:3100/otlp
endpoint: http://127.0.0.1:3100/otlp
debug/metrics:
verbosity: detailed
debug/traces:
Expand Down
2 changes: 1 addition & 1 deletion examples/java/run.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if not exist ./%jar% (
curl -sL https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/%version%/opentelemetry-javaagent.jar -o %jar%
)

set OTEL_RESOURCE_ATTRIBUTES=service.name=rolldice,service.instance.id=localhost:8080
set OTEL_RESOURCE_ATTRIBUTES=service.name=rolldice,service.instance.id=127.0.0.1:8080
@REM uncomment the next line to switch to Prometheus native histograms.
@REM set OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION=base2_exponential_bucket_histogram
java -Dotel.metric.export.interval=500 -Dotel.bsp.schedule.delay=500 -javaagent:%jar% -jar ./target/rolldice.jar
2 changes: 1 addition & 1 deletion examples/java/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [[ ! -f ./${jar} ]]; then
curl -vL https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${opentelemetry_javaagent_version}/opentelemetry-javaagent.jar -o ${jar} # editorconfig-checker-disable-line

fi
export OTEL_RESOURCE_ATTRIBUTES="service.name=rolldice,service.instance.id=localhost:8080"
export OTEL_RESOURCE_ATTRIBUTES="service.name=rolldice,service.instance.id=127.0.0.1:8080"
# uncomment the next line to switch to Prometheus native histograms.
# export OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION=base2_exponential_bucket_histogram
java -Dotel.metric.export.interval=500 -Dotel.bsp.schedule.delay=500 -javaagent:${jar} -jar ./target/rolldice.jar
2 changes: 1 addition & 1 deletion examples/nodejs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ app.get('/rolldice', (req, res) => {
})

app.listen(PORT, () => {
console.log(`Listening for requests on http://localhost:${PORT}`)
console.log(`Listening for requests on http://127.0.0.1:${PORT}`)
})
2 changes: 1 addition & 1 deletion examples/python/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -euo pipefail

export OTEL_METRIC_EXPORT_INTERVAL="5000" # so we don't have to wait 60s for metrics
export OTEL_RESOURCE_ATTRIBUTES="service.name=rolldice,service.instance.id=localhost:8082"
export OTEL_RESOURCE_ATTRIBUTES="service.name=rolldice,service.instance.id=127.0.0.1:8082"

python3 -m venv venv
# shellcheck disable=SC1091
Expand Down
10 changes: 5 additions & 5 deletions generate-traffic.cmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@ECHO OFF
:loop
cls
curl -s http://localhost:8080/rolldice
curl -s http://localhost:8081/rolldice
curl -s http://localhost:8082/rolldice
curl -s http://localhost:8083/rolldice
curl -s http://localhost:8084/rolldice
curl -s http://127.0.0.1:8080/rolldice
curl -s http://127.0.0.1:8081/rolldice
curl -s http://127.0.0.1:8082/rolldice
curl -s http://127.0.0.1:8083/rolldice
curl -s http://127.0.0.1:8084/rolldice
timeout /t 2
goto loop
10 changes: 5 additions & 5 deletions generate-traffic.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

watch 'curl -s http://localhost:8080/rolldice; \
curl -s http://localhost:8081/rolldice; \
curl -s http://localhost:8082/rolldice; \
curl -s http://localhost:8083/rolldice; \
curl -s http://localhost:8084/rolldice?rolls=5'
watch 'curl -s http://127.0.0.1:8080/rolldice; \
curl -s http://127.0.0.1:8081/rolldice; \
curl -s http://127.0.0.1:8082/rolldice; \
curl -s http://127.0.0.1:8083/rolldice; \
curl -s http://127.0.0.1:8084/rolldice?rolls=5'
Loading