@@ -11,12 +11,11 @@ pip install ustack-logging
1111## Usage  ## 
1212
1313``` python 
14- import  os
1514from  ustack_logging.logging_configuration import  configure_logging
1615
1716
1817def  main ():
19-     configure_logging(os.environ )
18+     configure_logging()
2019
2120    #  Run your application
2221
@@ -32,11 +31,9 @@ applications log and report errors when running inside Kubernetes. It
3231takes no configuration because its intent is to enforce a
3332configuration.
3433
35- However, it is built on separate libraries that * are*  configurable:
36- [ datadog-logger] ( https://github.com/ustudio/datadog-logger )  and
37- [ kubernetes-downward-api] ( https://github.com/ustudio/kubernetes-downward-api ) . If
38- you need a different configuration, it should be trivial to implement
39- it using those libraries.
34+ However, it is built on [ datadog-logger] ( https://github.com/ustudio/datadog-logger ) ,
35+ which is configurable. If you need a different configuration, it
36+ should be trivial to implement it using that library directly.
4037
4138## Configuration  ## 
4239
@@ -46,18 +43,17 @@ It sets up the logging library to log the time, log level, module name
4643and log message for every message, and it sets the current log level
4744to ` INFO ` .
4845
49- It connects  to Datadog using the  environment variables 
50- ` DATADOG_API_KEY `  and  ` DATADOG_APP_KEY ` , and parses  the Kubernetes 
51- namespace  and labels out of a Kubernetes Downward API VolumeMount at 
52- ` /etc/podinfo ` .
46+ In order  to function, it uses a secret named  ` environment-info  `  in the 
47+ ` ustudio-system `  namespace. The secret must contain  the keys 
48+ ` environment `  and ` datadog-api-key ` , and the pod must contain a label 
49+ named  ` role ` .
5350
54- If the environment variables are not set (or are incorrect) or the
55- Downward API VolumeMount isn't available it logs a warning and does
56- not error.
51+ If any information is missing or any connections fail it logs a
52+ warning and does not error.
5753
5854It configures the ` datadog-logger `  library to send ` ERROR `  and above
5955log messages to Datadog as events, with the following tag mapping:
6056
61- *  K8s Namespace  -> Datadog tag ` environment ` 
62- *  K8s Pod Label  ` app `  -> Datadog tag ` service ` 
57+ *  ` environment-info.environment `  -> Datadog tag ` environment ` 
58+ *  K8s Pod Namespace  -> Datadog tag ` service ` 
6359*  K8s Pod Label ` role `  -> Datadog tag ` role ` 
0 commit comments