Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Active Directory Domain Services metrics receiver #563

Merged
merged 8 commits into from
Apr 29, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions apps/active_directory_ds.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,39 @@ package apps
import (
"github.com/GoogleCloudPlatform/ops-agent/confgenerator"
"github.com/GoogleCloudPlatform/ops-agent/confgenerator/fluentbit"
"github.com/GoogleCloudPlatform/ops-agent/confgenerator/otel"
)

type MetricsReceiverActiveDirectoryDS struct {
confgenerator.ConfigComponent `yaml:",inline"`
confgenerator.MetricsReceiverShared `yaml:",inline"`
}

func (r MetricsReceiverActiveDirectoryDS) Type() string {
return "active_directory_ds"
}

func (r MetricsReceiverActiveDirectoryDS) Pipelines() []otel.Pipeline {
return []otel.Pipeline{{
Receiver: otel.Component{
Type: "active_directory_ds",
Config: map[string]interface{}{
"collection_interval": r.CollectionIntervalString(),
},
},
Processors: []otel.Component{
otel.NormalizeSums(),
otel.MetricsTransform(
otel.AddPrefix("workload.googleapis.com"),
),
},
}}
}

func init() {
confgenerator.MetricsReceiverTypes.RegisterType(func() confgenerator.Component { return &MetricsReceiverActiveDirectoryDS{} }, "windows")
}

type LoggingReceiverActiveDirectoryDS struct {
confgenerator.ConfigComponent `yaml:",inline"`
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
metrics receiver with type "active_directory_ds" is not supported. Supported metrics receiver types: [activemq, apache, cassandra, couchdb, elasticsearch, hadoop, hbase, hostmetrics, jvm, kafka, memcached, mongodb, mysql, nginx, postgresql, rabbitmq, redis, solr, tomcat, varnish, wildfly, zookeeper].
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
metrics:
receivers:
active_directory_ds:
type: active_directory_ds
service:
pipelines:
active_directory_ds:
receivers:
- active_directory_ds
Original file line number Diff line number Diff line change
@@ -1 +1 @@
metrics receiver with type "unsupported_type" is not supported. Supported metrics receiver types: [activemq, apache, cassandra, couchdb, elasticsearch, hadoop, hbase, hostmetrics, iis, jvm, kafka, memcached, mongodb, mssql, mysql, nginx, postgresql, rabbitmq, redis, solr, tomcat, varnish, wildfly, zookeeper].
metrics receiver with type "unsupported_type" is not supported. Supported metrics receiver types: [active_directory_ds, activemq, apache, cassandra, couchdb, elasticsearch, hadoop, hbase, hostmetrics, iis, jvm, kafka, memcached, mongodb, mssql, mysql, nginx, postgresql, rabbitmq, redis, solr, tomcat, varnish, wildfly, zookeeper].
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

function process(tag, timestamp, record)
local __field_0 = (function()
return record["logging.googleapis.com/logName"]
end)();
local v = __field_0;
if v == nil then v = "windows_event_log" end;
(function(value)
record["logging.googleapis.com/logName"] = value
end)(v)
return 2, timestamp, record
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
@SET buffers_dir=C:\ProgramData\Google\Cloud Operations\Ops Agent\run/buffers
@SET logs_dir=C:\ProgramData\Google\Cloud Operations\Ops Agent\log

[SERVICE]
Daemon off
Flush 1
Log_Level info
dns.resolver legacy
storage.backlog.mem_limit 50M
storage.checksum on
storage.max_chunks_up 128
storage.metrics on
storage.sync normal

[INPUT]
Name fluentbit_metrics
Scrape_Interval 60
Scrape_On_Start True

[INPUT]
Channels System,Application,Security
DB ${buffers_dir}/default_pipeline_windows_event_log
Interval_Sec 1
Name winlog
Tag default_pipeline.windows_event_log

[INPUT]
Buffer_Chunk_Size 512k
Buffer_Max_Size 5M
DB ${buffers_dir}/ops-agent-fluent-bit
Key message
Mem_Buf_Limit 10M
Name tail
Path ${logs_dir}/logging-module.log
Read_from_Head True
Rotate_Wait 30
Skip_Long_Lines On
Tag ops-agent-fluent-bit
storage.type filesystem

[FILTER]
Key_Name TimeGenerated
Match default_pipeline.windows_event_log
Name parser
Preserve_Key True
Reserve_Data True
Parser default_pipeline.windows_event_log.timestamp_parser

[FILTER]
Add logging.googleapis.com/severity ERROR
Condition Key_Value_Equals EventType Error
Match default_pipeline.windows_event_log
Name modify

[FILTER]
Add logging.googleapis.com/severity INFO
Condition Key_Value_Equals EventType Information
Match default_pipeline.windows_event_log
Name modify

[FILTER]
Add logging.googleapis.com/severity WARNING
Condition Key_Value_Equals EventType Warning
Match default_pipeline.windows_event_log
Name modify

[FILTER]
Add logging.googleapis.com/severity NOTICE
Condition Key_Value_Equals EventType SuccessAudit
Match default_pipeline.windows_event_log
Name modify

[FILTER]
Add logging.googleapis.com/severity NOTICE
Condition Key_Value_Equals EventType FailureAudit
Match default_pipeline.windows_event_log
Name modify

[FILTER]
Match default_pipeline.windows_event_log
Name lua
call process
script e264973cb9c4706d884bb5e07270adb3.lua

[OUTPUT]
Match_Regex ^(default_pipeline\.windows_event_log)$
Name stackdriver
Retry_Limit 3
net.connect_timeout_log_error False
resource gce_instance
stackdriver_agent Google-Cloud-Ops-Agent-Logging/latest (BuildDistro=build_distro;Platform=windows;ShortName=win_platform;ShortVersion=win_platform_version)
tls On
tls.verify Off
workers 8

[OUTPUT]
Match_Regex ^(ops-agent-fluent-bit)$
Name stackdriver
Retry_Limit 3
net.connect_timeout_log_error False
resource gce_instance
stackdriver_agent Google-Cloud-Ops-Agent-Logging/latest (BuildDistro=build_distro;Platform=windows;ShortName=win_platform;ShortVersion=win_platform_version)
tls On
tls.verify Off
workers 8

[OUTPUT]
Match *
Name prometheus_exporter
host 0.0.0.0
port 20202
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[PARSER]
Format regex
Name default_pipeline.windows_event_log.timestamp_parser
Regex (?<timestamp>\d+-\d+-\d+ \d+:\d+:\d+ [+-]\d{4})
Time_Format %Y-%m-%d %H:%M:%S %z
Time_Key timestamp
Loading