This repository was archived by the owner on Sep 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
114 additions
and
187 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"restructuredtext.confPath": "" | ||
} |
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 |
---|---|---|
@@ -1 +1,46 @@ | ||
# otel-fso-launcher | ||
# otel-py | ||
|
||
[![Apache License][license-image]][license-image] | ||
|
||
Alpha version | ||
|
||
This package provides a Cisco Launcher for OpenTelemetry python | ||
|
||
## Installation | ||
|
||
pip | ||
|
||
```sh | ||
pip install cisco-otel-py | ||
``` | ||
|
||
poetry | ||
```sh | ||
poetry add cisco-otel-py | ||
``` | ||
|
||
## Usage | ||
```python | ||
from cisco_otel_py import trace | ||
|
||
trace.init() | ||
``` | ||
|
||
## Configuration | ||
|
||
Advanced options can be configured as a parameter to the init() method: | ||
|
||
| Parameter | Env | Type | Default | Description | | ||
| --------------- | ---------------------- | ------- | ------------- | ----------------------------------------------------------------- | | ||
| ciscoToken | CISCO_TOKEN | string | - | Cisco account token | | ||
| serviceName | OTEL_SERVICE_NAME | string | `application` | Application name that will be set for traces | | ||
| debug | CISCO_DEBUG | string | `false` | Debug logs | | ||
| payloadsEnabled | CISCO_PAYLOADS_ENABLED | boolean | `false` | The number in bytes of the maximum payload to capture for request | | ||
| maxPayloadSize | CISCO_MAX_PAYLOAD_SIZE | number | `1024` | The number in bytes of the maximum payload to capture for request | | ||
|
||
Exporter options | ||
|
||
| Parameter | Env | Type | Default | Description | | ||
| ----------------- | ----------------------- | ------ | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| collectorEndpoint | OTEL_COLLECTOR_ENDPOINT | string | `http://localhost:4317` | The address of the trace collector to send traces to | | ||
| type. | OTEL_EXPORTER_TYPE | string | `otlp-grpc` | The exporter type to use (Currently `otlp-grpc`, `otlp-http` are supported). Multiple exporter option available via init function see example below | |
Empty file.
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 |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
limitations under the License. | ||
""" | ||
|
||
|
||
from .trace import init | ||
|
||
__version__ = '0.1.0' |
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,21 @@ | ||
""" | ||
Copyright The Cisco Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
""" | ||
|
||
from opentelemetry.instrumentation.bootstrap import run as otel_bootstrap | ||
|
||
|
||
def run() -> None: | ||
otel_bootstrap() |
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 @@ | ||
""" | ||
Copyright The Cisco Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
https://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
""" | ||
|
||
from opentelemetry.instrumentation.bootstrap import run as otel_bootstrap | ||
from opentelemetry.instrumentation.auto_instrumentation import run as otel_run | ||
|
||
|
||
def run() -> None: | ||
otel_run() | ||
|
||
|
||
def boot() -> None: | ||
otel_bootstrap() |
File renamed without changes.
File renamed without changes.
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
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
[tool.poetry] | ||
name = "otel-py" | ||
name = "cisco-otel-py" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["SDK <[email protected]>"] | ||
description = "a minimal python Cisco Launcher for OpenTelemetry" | ||
license = "Apache-2.0" | ||
authors = ["Cisco Epsagon Team <[email protected]>"] | ||
readme = readme.md | ||
repository = "https://github.com/epsagon/otel-py" | ||
|
||
[tool.poetry.scripts] | ||
otel-py = 'otel_fso_launcher.cmd.trace:run' | ||
otel-py-bootstrap = 'otel_fso_launcher.cmd.bootstrap:run' | ||
otel-py-boot = 'otel_fso_launcher.cmd.trace:boot' | ||
otel-py = 'cisco_otel_py.cmd.trace:run' | ||
otel-py-bootstrap = 'cisco_otel_py.cmd.bootstrap:run' | ||
otel-py-boot = 'cisco_otel_py.cmd.trace:boot' | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.9" | ||
|
This file was deleted.
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