@@ -11,23 +11,18 @@ import (
1111 "go.opentelemetry.io/collector/confmap"
1212 "go.opentelemetry.io/collector/extension"
1313
14- "github.com/aws/amazon-cloudwatch-agent/tool/paths "
14+ "github.com/aws/amazon-cloudwatch-agent/translator/translate/logs/util "
1515 "github.com/aws/amazon-cloudwatch-agent/translator/translate/otel/common"
1616)
1717
18- const (
19- name = "journald"
20- )
21-
2218type translator struct {
2319 factory extension.Factory
2420}
2521
2622var _ common.ComponentTranslator = (* translator )(nil )
2723
28- // StorageComponentID returns the component.ID for the file_storage/journald extension.
29- func StorageComponentID () component.ID {
30- return component .NewIDWithName (filestorage .NewFactory ().Type (), name )
24+ func ComponentID () component.ID {
25+ return component .NewIDWithName (filestorage .NewFactory ().Type (), common .OpenTelemetryKey )
3126}
3227
3328func NewTranslator () common.ComponentTranslator {
@@ -37,12 +32,14 @@ func NewTranslator() common.ComponentTranslator {
3732}
3833
3934func (t * translator ) ID () component.ID {
40- return component .NewIDWithName (t .factory .Type (), name )
35+ return component .NewIDWithName (t .factory .Type (), common . OpenTelemetryKey )
4136}
4237
4338func (t * translator ) Translate (_ * confmap.Conf ) (component.Config , error ) {
4439 cfg := t .factory .CreateDefaultConfig ().(* filestorage.Config )
45- cfg .Directory = filepath .Join (paths .AgentDir , "logs" , "state" )
40+ dir := filepath .Join (util .GetFileStateFolder (), "otel" )
41+ cfg .Directory = dir
42+ cfg .Compaction .Directory = dir
4643 cfg .CreateDirectory = true
4744 return cfg , nil
4845}
0 commit comments