-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Open telemetry properly supported by python and rust log implementati…
…ons, otel collector for collecting and openobserve for viewing (#17) * Open telemetry properly supported by python and rust log implementations, otel collector for collecting and openobserve for viewing * Fix ci by disabling coverage for some blocks, is tested but not in CI * Fix ci by disabling coverage for some blocks, is tested but not in CI
- Loading branch information
Showing
39 changed files
with
9,137 additions
and
8,445 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ private/ | |
!*private*.*.zetch | ||
|
||
process_data/ | ||
logs/ | ||
|
||
# Tempate files | ||
.cop.*.yml | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,26 @@ | ||
#!/bin/bash | ||
set -e # Exit on error | ||
|
||
# Hook into live logs from a detached running container. | ||
logs () { | ||
# Check if a container name is provided | ||
if [ $# -eq 0 ]; then | ||
echo "Usage: $0 CONTAINER_NAME" | ||
exit 1 | ||
fi | ||
|
||
# Retrieve the container name | ||
CONTAINER_NAME=$1 | ||
|
||
# Trap Ctrl+C to disconnect from logs | ||
trap 'echo "Ctrl+C pressed. Disconnecting from logs..."' INT | ||
|
||
# Hook into the logs of the specified container | ||
docker logs -f "$CONTAINER_NAME" | ||
|
||
# Script execution continues after disconnecting from logs | ||
echo "Disconnected from logs, but container is still running." | ||
} | ||
|
||
# Has to come at the end of these files: | ||
source ./dev_scripts/_scr_setup/setup.sh "$@" |
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 |
---|---|---|
|
@@ -3,6 +3,38 @@ | |
# Stop on error: | ||
set -e | ||
|
||
# Starts the open telemetry collector in a docker container if not already started | ||
ensure_collector () { | ||
# Define the name of the Docker container | ||
CONTAINER_NAME="collector_bitbazaar" | ||
|
||
if [ "$(./dev_scripts/utils.sh in_ci)" = "true" ]; then | ||
echo "In CI, not starting open telemetry collector." | ||
else | ||
# Check if the container is already running | ||
if [ "$(docker inspect -f '{{.State.Running}}' $CONTAINER_NAME 2>/dev/null)" = "true" ]; then | ||
echo "Open telemetry collector as container '$CONTAINER_NAME' already running!" | ||
else | ||
# Start the container | ||
echo "Starting open telemetry collector as container '$CONTAINER_NAME'..." | ||
# - Link the config file | ||
# - Link the ./logs/ directory to /logs/ in the container | ||
# - Collector listens for inputs from programs on 4317 | ||
# - Runs in detached mode | ||
docker run --rm --name $CONTAINER_NAME \ | ||
-v $(pwd)/opencollector.yaml:/etc/otelcol-contrib/config.yaml \ | ||
-v $(pwd)/logs:/logs \ | ||
-p 127.0.0.1:4317:4317 \ | ||
-d \ | ||
otel/opentelemetry-collector-contrib:0.94.0 | ||
fi | ||
fi | ||
} | ||
|
||
# Starts the openobserve server to look at dev logs/traces/metrics | ||
oo () { | ||
ZO_ROOT_USER_EMAIL="[email protected]" ZO_ROOT_USER_PASSWORD="pass" openobserve | ||
} | ||
|
||
# Has to come at the end of these files: | ||
source ./dev_scripts/_scr_setup/setup.sh "$@" |
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
Oops, something went wrong.