-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure OTEL Collector to observe Internal Telemetry (#5752)
**Which problem is this PR solving?** This PR addresses a part of the issue [#5633 ](#5633) **Description of the changes** This is a Draft PR to achieve Observability Parity between V1 and V2 components by configuring OTEL Collector config files to initialise internal tracer and metrics **How was this change tested?** The changes were tested by running the following command: ```bash make test ``` ```bash CI actions ``` **Checklist** - [x] I have read [CONTRIBUTING_GUIDELINES.md](https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md) - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - `for jaeger: make lint test` - `for jaeger-ui: yarn lint` and `yarn test` --------- Signed-off-by: Wise-Wizard <[email protected]> Signed-off-by: Yuri Shkuro <[email protected]> Signed-off-by: Saransh Shankar <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]>
- Loading branch information
1 parent
e437971
commit 0f687f4
Showing
5 changed files
with
82 additions
and
4 deletions.
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
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
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
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
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,62 @@ | ||
# Run the following commands first to create the JSON files: | ||
# Run V1 Binary | ||
# prom2json http://localhost:14269/metrics > V1_Metrics.json | ||
# Run V2 Binary | ||
# prom2json http://localhost:8888/metrics > V2_Metrics.json | ||
|
||
import json | ||
|
||
# Load the JSON files | ||
v1_metrics_path = "./V1_Metrics.json" | ||
v2_metrics_path = "./V2_Metrics.json" | ||
|
||
with open(v1_metrics_path, 'r') as file: | ||
v1_metrics = json.load(file) | ||
|
||
with open(v2_metrics_path, 'r') as file: | ||
v2_metrics = json.load(file) | ||
|
||
# Extract names and labels of the metrics | ||
def extract_metrics_with_labels(metrics): | ||
result = {} | ||
for metric in metrics: | ||
name = metric['name'] | ||
labels = {} | ||
if 'metrics' in metric and 'labels' in metric['metrics'][0]: | ||
labels = metric['metrics'][0]['labels'] | ||
result[name] = labels | ||
return result | ||
|
||
v1_metrics_with_labels = extract_metrics_with_labels(v1_metrics) | ||
v2_metrics_with_labels = extract_metrics_with_labels(v2_metrics) | ||
|
||
# Compare the metrics names and labels | ||
common_metrics = {} | ||
v1_only_metrics = {} | ||
v2_only_metrics = {} | ||
|
||
for name, labels in v1_metrics_with_labels.items(): | ||
if name in v2_metrics_with_labels: | ||
if labels == v2_metrics_with_labels[name]: | ||
common_metrics[name] = labels | ||
else: | ||
v1_only_metrics[name] = labels | ||
else: | ||
v1_only_metrics[name] = labels | ||
|
||
for name, labels in v2_metrics_with_labels.items(): | ||
if name not in v1_metrics_with_labels: | ||
v2_only_metrics[name] = labels | ||
|
||
differences = { | ||
"common_metrics": common_metrics, | ||
"v1_only_metrics": v1_only_metrics, | ||
"v2_only_metrics": v2_only_metrics | ||
} | ||
|
||
# Write the differences to a new JSON file | ||
differences_path = "./differences.json" | ||
with open(differences_path, 'w') as file: | ||
json.dump(differences, file, indent=4) | ||
|
||
print(f"Differences written to {differences_path}") |