-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
cd49455
commit 372bd73
Showing
15 changed files
with
352 additions
and
41 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
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
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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from opentelemetry.sdk._logs import LogRecordProcessor, LogData | ||
|
||
|
||
class LumigoLogRecordProcessor(LogRecordProcessor): | ||
def emit(self, log_data: LogData) -> None: | ||
# This class is used by __init__, so moving this to the enclosing scope will result in a circular import | ||
from lumigo_opentelemetry.libs.json_utils import dump | ||
|
||
log_data.log_record.body = dump(log_data.log_record.body) | ||
|
||
def shutdown(self) -> None: | ||
pass | ||
|
||
def force_flush(self, timeout_millis: int = 30000) -> None: | ||
pass |
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
Empty file.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from lumigo_opentelemetry import logger_provider, tracer_provider | ||
import logging | ||
|
||
tracer = tracer_provider.get_tracer(__file__) | ||
logger = logging.getLogger(__name__) | ||
logger.setLevel(logging.DEBUG) | ||
|
||
|
||
def write_log(message): | ||
log = { | ||
"some-thing": message, | ||
"some-super-sekret-stuff": "this is a secret", | ||
} | ||
|
||
logger.debug(log) | ||
|
||
|
||
write_log(message="with no recording span") | ||
|
||
with tracer.start_as_current_span("some-span") as span: | ||
write_log("with recording span") | ||
|
||
logger_provider.force_flush() | ||
logger_provider.shutdown() |
Empty file.
Oops, something went wrong.