{"id":15137768,"url":"https://github.com/serkan-ozal/otel-bash","last_synced_at":"2025-10-23T13:30:48.007Z","repository":{"id":181617639,"uuid":"666481168","full_name":"serkan-ozal/otel-bash","owner":"serkan-ozal","description":"Bash library to instrument and trace bash scripts automatically with OpenTelemetry","archived":false,"fork":false,"pushed_at":"2023-09-19T18:55:42.000Z","size":434,"stargazers_count":41,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T18:48:16.838Z","etag":null,"topics":["bash","bash-script","bash-scripting","instrumentation","monitoring","observability","open-telemetry","opentelemetry","tracing"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serkan-ozal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-14T16:18:28.000Z","updated_at":"2025-01-21T18:34:36.000Z","dependencies_parsed_at":"2024-09-21T11:30:29.271Z","dependency_job_id":"2dfe068c-c753-4aa1-958b-98dd546513ab","html_url":"https://github.com/serkan-ozal/otel-bash","commit_stats":null,"previous_names":["serkan-ozal/otel-bash"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkan-ozal%2Fotel-bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkan-ozal%2Fotel-bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkan-ozal%2Fotel-bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serkan-ozal%2Fotel-bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serkan-ozal","download_url":"https://codeload.github.com/serkan-ozal/otel-bash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237834583,"owners_count":19373754,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-script","bash-scripting","instrumentation","monitoring","observability","open-telemetry","opentelemetry","tracing"],"created_at":"2024-09-26T07:01:54.498Z","updated_at":"2025-10-23T13:30:47.566Z","avatar_url":"https://github.com/serkan-ozal.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OTEL (OpenTelemetry) Bash\n\n![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)\n\n`otel-bash` is a bash library to instrument, debug and trace bash scripts automatically with OpenTelemetry.\n\n## Prerequisites\n- Bash `3.2+` or `4.x`\n- [`otel-cli` v1](https://github.com/serkan-ozal/otel-cli)\n\n## Setup\n\n1. Add `otel-bash` in the beginning (for ex. just after bash she-bang `#!/bin/bash`) of your script \n\n  - Source `otel-bash.sh` in your script:\n    ```bash\n    . \"${OTEL_BASH_PATH}/otel_bash.sh\"\n    # or\n    # source \"${OTEL_BASH_PATH}/otel_bash.sh\"\n    ```\n\n  - or get the **latest** version of the `otel-bash` from remote:\n    ```bash\n    . /dev/stdin \u003c\u003c\u003c \"$(curl -s https://raw.githubusercontent.com/serkan-ozal/otel-bash/master/otel_bash.sh)\"\n    # or if your bash supports process substitution (version \"4.x\")\n    # . \u003c(curl -s https://raw.githubusercontent.com/serkan-ozal/otel-bash/master/otel_bash.sh)\n    ```\n\n  - or get specific version (`v\u003cversion\u003e`) of the `otel-bash` from remote (For example, `v0.0.1` for the `0.0.1` version of the `otel-bash`):\n    ```bash\n    . /dev/stdin \u003c\u003c\u003c \"$(curl -s https://raw.githubusercontent.com/serkan-ozal/otel-bash/v0.0.1/otel_bash.sh)\"\n    # or if your bash supports process substitution (version \"4.x\")\n    # . \u003c(curl -s https://raw.githubusercontent.com/serkan-ozal/otel-bash/v0.0.1/otel_bash.sh)\n    ```\n\n2. Run your script by configuring OTLP `HTTP/JSON` endpoint\n\n  ```bash\n  OTEL_EXPORTER_OTLP_ENDPOINT=\u003cOTLP_ENDPOINT_URL\u003e ./\u003cyour-script\u003e.sh\n  ```\n\n  - ### Run With Jaeger\n\n    - Run Jaeger as OTLP HTTP/JSON endpoint active:\n      ```bash\n      docker run -d --name jaeger -p 4318:4318 -p 16686:16686 jaegertracing/all-in-one:1.47\n      ```\n\n    - Make sure that Jaeger works by opening Jaeger UI at [http://localhost:16686](http://localhost:16686)\n\n    - Run your script with Jaeger OTLP HTTP/JSON endpoint config:\n      ```bash\n      OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 ../\u003cyour-script\u003e.sh\n      ```\n\n    - Search your traces in Jaeger UI\n      ![Search Traces](./examples/release-process/images/search-trace.png)\n\n    - And see your trace in Jaeger UI\n      ![See Trace](./examples/release-process/images/see-trace.png)\n\n  - ### Run With OTEL SaaS Vendors\n\n    - Run your script with your OTEL Saas vendor OTLP HTTP/JSON endpoint and API authentication token configs: \n      ```bash\n      OTEL_EXPORTER_OTLP_ENDPOINT=\u003cYOUR-OTEL-VENDOR-OTLP-ENDPOINT\u003e \\\n      OTEL_EXPORTER_OTLP_HEADERS=\u003cYOUR-OTEL-VENDOR-API-AUTH-HEADER-NAME\u003e=\u003cYOUR-OTEL-VENDOR-API-AUTH-TOKEN\u003e \\\n      ./\u003cyour-script\u003e.sh\n      ```\n\n## Configuration\n\n| Environment Variable                                                 | Mandatory | Choices                                              | Default Value | Description                                    | Example                                                               |\n|----------------------------------------------------------------------|-----------|------------------------------------------------------|---------------|------------------------------------------------|-----------------------------------------------------------------------|\n| `OTEL_EXPORTER_OTLP_ENDPOINT=\u003cotlp-endpoint-url\u003e`                    | YES       |                                                      |               | OTEL Exporter OTLP endpoint                    | `OTEL_EXPORTER_OTLP_ENDPOINT=https://collector.otel.io`               |\n| `OTEL_EXPORTER_OTLP_HEADERS=\u003capi-auth-header-name\u003e=\u003capi-auth-token\u003e` | NO        |                                                      |               | OTEL Exporter OTLP endpoint API auth token     | `OTEL_EXPORTER_OTLP_HEADERS=x-vendor-api-key=abcdefgh-12345678`       |\n| `TRACEPARENT=\u003ctraceparent-header\u003e`                                   | NO        |                                                      |               | Traceparent header in W3C trace context format | `TRACEPARENT=00-84b54e9330faae5350f0dd8673c98146-279fa73bc935cc05-01` |\n| `OTEL_CLI_SERVER_PORT=\u003cport-no\u003e`                                     | NO        |                                                      | `7777`        | OTEL CLI server port to start on               | `OTEL_CLI_SERVER_PORT=1234`                                           |\n| `OTEL_BASH_LOG_LEVEL=\u003clog-level\u003e`                                    | NO        | - `DEBUG` \u003cbr\u003e - `INFO` \u003cbr\u003e - `WARN` \u003cbr\u003e - `ERROR` | `WARN`        | Configure log level                            | `OTEL_BASH_LOG_LEVEL=DEBUG`                                           | \n\n## Examples\n\nYou can find examples under `examples` directory:\n- [`Release Process` example](./examples/release-process/README.md)\n\n## Roadmap\n\n- Export traces to `otel-cli` over local HTTP call instead of running `otel-cli` process to reduce `otel-cli` overhead\n\n## Issues and Feedback\n\n[![Issues](https://img.shields.io/github/issues/serkan-ozal/otel-bash.svg)](https://github.com/serkan-ozal/otel-bash/issues?q=is%3Aopen+is%3Aissue)\n[![Closed issues](https://img.shields.io/github/issues-closed/serkan-ozal/otel-bash.svg)](https://github.com/serkan-ozal/otel-bash/issues?q=is%3Aissue+is%3Aclosed)\n\nPlease use [GitHub Issues](https://github.com/serkan-ozal/otel-bash/issues) for any bug report, feature request and support.\n\n## Contribution\n\n[![Pull requests](https://img.shields.io/github/issues-pr/serkan-ozal/otel-bash.svg)](https://github.com/serkan-ozal/otel-bash/pulls?q=is%3Aopen+is%3Apr)\n[![Closed pull requests](https://img.shields.io/github/issues-pr-closed/serkan-ozal/otel-bash.svg)](https://github.com/serkan-ozal/otel-bash/pulls?q=is%3Apr+is%3Aclosed)\n[![Contributors](https://img.shields.io/github/contributors/serkan-ozal/otel-bash.svg)]()\n\nIf you would like to contribute, please\n- Fork the repository on GitHub and clone your fork.\n- Create a branch for your changes and make your changes on it.\n- Send a pull request by explaining clearly what is your contribution.\n\n\u003e Tip:\n\u003e Please check the existing pull requests for similar contributions and\n\u003e consider submit an issue to discuss the proposed feature before writing code.\n\n## License\n\nLicensed under [Apache License 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkan-ozal%2Fotel-bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserkan-ozal%2Fotel-bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserkan-ozal%2Fotel-bash/lists"}