Skip to content

Commit

Permalink
README.md updated,
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Orlovsky committed Dec 2, 2024
1 parent 079dc18 commit d91ea11
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,21 @@ For example, you can add a programmatic error as follows:
```python
from lumigo_opentelemetry import create_programmatic_error

create_programmatic_error("Error message", "ErrorType")
create_programmatic_error("The customer 123 was not found", "CustomerNotExist")
```

The first argument, "Error message", is a descriptive message for the error, while the second argument, "ErrorType", represents the type of the error.

Alternately, programmatic errors can also be created by adding [span events](https://opentelemetry.io/docs/instrumentation/python/manual/#adding-events) with a custom attribute being set with the key name `lumigo.type`.

For example, you could add a programmatic error as follows:

```python
from opentelemetry.trace import get_current_span

get_current_span().add_event('<error-message>', {'lumigo.type': '<error-type>'})
```

## Python 3.7 Support

**Deprecation Notice:** As of version 1.0.156, support for Python 3.7 has been deprecated. The last version of the Lumigo OpenTelemetry Distro to support Python 3.7 is version 1.0.155.
Expand Down

0 comments on commit d91ea11

Please sign in to comment.