Skip to content

Commit dd328e9

Browse files
committed
Add logs config section
1 parent 8f31b1f commit dd328e9

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

hugging_face_tgi/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,38 @@ No additional installation is needed on your server.
3636
3737
3. [Restart the Agent][5].
3838
39+
#### Logs
40+
41+
The Hugging Face TGI integration can collect logs from the server container and forward them to Datadog.
42+
43+
<!-- xxx tabs xxx -->
44+
<!-- xxx tab "Host" xxx -->
45+
46+
1. Collecting logs is disabled by default in the Datadog Agent. Enable it in your `datadog.yaml` file:
47+
48+
```yaml
49+
logs_enabled: true
50+
```
51+
52+
2. Uncomment and edit the logs configuration block in your `hugging_face_tgi.d/conf.yaml` file. Here's an example:
53+
54+
```yaml
55+
logs:
56+
- type: docker
57+
source: hugging_face_tgi
58+
service: hugging_face_tgi
59+
```
60+
61+
<!-- xxz tab xxx -->
62+
<!-- xxx tab "Kubernetes" xxx -->
63+
64+
Collecting logs is disabled by default in the Datadog Agent. To enable it, see [Kubernetes Log Collection][13].
65+
66+
Then, set Log Integrations as pod annotations. This can also be configured with a file, a configmap, or a key-value store. For more information, see the configuration section of [Kubernetes Log Collection][14].
67+
68+
<!-- xxz tab xxx -->
69+
<!-- xxz tabs xxx -->
70+
3971
### Validation
4072

4173
[Run the Agent's status subcommand][6] and look for `hugging_face_tgi` under the Checks section.

hugging_face_tgi/assets/configuration/spec.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ files:
1313
openmetrics_endpoint.description: |
1414
Endpoint exposing Hugging Face TGI's Prometheus metrics. For more information, refer to
1515
https://huggingface.co/docs/text-generation-inference/en/basic_tutorials/monitoring
16+
- template: logs
17+
example:
18+
- type: docker
19+
source: hugging_face_tgi
20+
service: <SERVICE>

hugging_face_tgi/datadog_checks/hugging_face_tgi/data/conf.yaml.example

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,3 +640,23 @@ instances:
640640
# - <INCLUDE_REGEX>
641641
# exclude:
642642
# - <EXCLUDE_REGEX>
643+
644+
## Log Section
645+
##
646+
## type - required - Type of log input source (tcp / udp / file / windows_event).
647+
## port / path / channel_path - required - Set port if type is tcp or udp.
648+
## Set path if type is file.
649+
## Set channel_path if type is windows_event.
650+
## source - required - Attribute that defines which integration sent the logs.
651+
## encoding - optional - For file specifies the file encoding. Default is utf-8. Other
652+
## possible values are utf-16-le and utf-16-be.
653+
## service - optional - The name of the service that generates the log.
654+
## Overrides any `service` defined in the `init_config` section.
655+
## tags - optional - Add tags to the collected logs.
656+
##
657+
## Discover Datadog log collection: https://docs.datadoghq.com/logs/log_collection/
658+
#
659+
# logs:
660+
# - type: docker
661+
# source: hugging_face_tgi
662+
# service: <SERVICE>

0 commit comments

Comments
 (0)