diff --git a/README.md b/README.md index e6397507..65ba8f51 100644 --- a/README.md +++ b/README.md @@ -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('', {'lumigo.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.