2.1 File Storage Configuration
In this exercise, we will update the extensions: section of the agent.yaml file. This section is part of the OpenTelemetry configuration YAML and defines optional components that enhance or modify the OpenTelemetry Collector’s behavior.
While these components do not process telemetry data directly, they provide valuable capabilities and services to improve the Collector’s functionality.
Exercise
Important
Change ALL terminal windows to the 2-building-resilience directory and run the clear command.
Your directory structure will look like this:
Update the agent.yaml: In the Agent terminal window, add the file_storage extension under the existing health_check extension:
Add file_storage to the exporter: Modify the otlphttp exporter to configure retry and queuing mechanisms, ensuring data is retained and resent if failures occur. Add the following under the endpoint: "http://localhost:5318" and make sure the indentation matches endpoint:
Update the services section: Add the file_storage/checkpoint extension to the existing extensions: section and the configuration needs to look like this:
Update the metrics pipeline: For this exercise we are going to comment out the hostmetrics receiver from the Metric pipeline to reduce debug and log noise, again the configuration needs to look like this:
Validate the Agent configuration using otelbin.io. For reference, the metrics: section of your pipelines will look similar to this:
%%{init:{"fontFamily":"monospace"}}%%
graph LR
%% Nodes
REC1( otlp <br>fa:fa-download):::receiver
PRO1(memory_limiter<br>fa:fa-microchip):::processor
PRO2(resourcedetection<br>fa:fa-microchip):::processor
PRO3(resource<br>fa:fa-microchip<br>add_mode):::processor
EXP1( debug <br>fa:fa-upload):::exporter
EXP2(otlphttp<br>fa:fa-upload):::exporter
EXP3( file <br>fa:fa-upload):::exporter
%% Links
subID1:::sub-metrics
subgraph " "
subgraph subID1[**Metrics**]
direction LR
REC1 --> PRO1
PRO1 --> PRO2
PRO2 --> PRO3
PRO3 --> EXP1
PRO3 --> EXP3
PRO3 --> EXP2
end
end
classDef receiver,exporter fill:#8b5cf6,stroke:#333,stroke-width:1px,color:#fff;
classDef processor fill:#6366f1,stroke:#333,stroke-width:1px,color:#fff;
classDef con-receive,con-export fill:#45c175,stroke:#333,stroke-width:1px,color:#fff;
classDef sub-metrics stroke:#38bdf8,stroke-width:1px, color:#38bdf8,stroke-dasharray: 3 3;