diff --git a/.schemagen.yaml b/.schemagen.yaml index 5bfa0b485531f..9ed10fb8606fe 100644 --- a/.schemagen.yaml +++ b/.schemagen.yaml @@ -11,6 +11,9 @@ mappings: go.opentelemetry.io/collector/component: ID: schemaType: string + github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator: + Config: + schemaType: "" golang.org/x/time/rate: Limit: schemaType: number diff --git a/Makefile b/Makefile index 9180972a5b4ec..6fadbd7a149de 100644 --- a/Makefile +++ b/Makefile @@ -702,7 +702,7 @@ generate-gh-issue-templates: SCHEMA_DIRS := $(shell find $(CURDIR) -path "*testdata*" -prune -o -name "config.schema.yaml" -exec dirname {} \; | sort -u) .PHONY: generate-schemas -generate-schemas: +generate-schemas: $(SCHEMAGEN) @$(foreach dir,$(SCHEMA_DIRS), $(SCHEMAGEN) $(dir) -o $(dir);) .PHONY: checks diff --git a/internal/coreinternal/consumerretry/config.schema.yaml b/internal/coreinternal/consumerretry/config.schema.yaml new file mode 100644 index 0000000000000..b2a1d2b37399e --- /dev/null +++ b/internal/coreinternal/consumerretry/config.schema.yaml @@ -0,0 +1,20 @@ +$defs: + config: + description: Config defines configuration for retrying batches in case of receiving a retryable error from a downstream consumer. If the retryable error doesn't provide a delay, exponential backoff is applied. + type: object + properties: + enabled: + description: Enabled indicates whether to not retry sending logs in case of receiving a retryable error from a downstream consumer. Default is false. + type: boolean + initial_interval: + description: InitialInterval the time to wait after the first failure before retrying. Default value is 1 second. + type: string + format: duration + max_elapsed_time: + description: MaxElapsedTime is the maximum amount of time (including retries) spent trying to send a logs batch to a downstream consumer. Once this value is reached, the data is discarded. It never stops if MaxElapsedTime == 0. Default value is 5 minutes. + type: string + format: duration + max_interval: + description: MaxInterval is the upper bound on backoff interval. Once this value is reached the delay between consecutive retries will always be `MaxInterval`. Default value is 30 seconds. + type: string + format: duration diff --git a/pkg/stanza/adapter/config.schema.yaml b/pkg/stanza/adapter/config.schema.yaml new file mode 100644 index 0000000000000..3cd84eb5119db --- /dev/null +++ b/pkg/stanza/adapter/config.schema.yaml @@ -0,0 +1,15 @@ +$defs: + base_config: + description: BaseConfig is the common configuration of a stanza-based receiver + type: object + properties: + operators: + type: array + items: + x-customType: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator.Config + retry_on_failure: + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/consumerretry.config + storage: + x-pointer: true + type: string + x-customType: go.opentelemetry.io/collector/component.ID diff --git a/pkg/stanza/entry/config.schema.yaml b/pkg/stanza/entry/config.schema.yaml new file mode 100644 index 0000000000000..252fafd564982 --- /dev/null +++ b/pkg/stanza/entry/config.schema.yaml @@ -0,0 +1,4 @@ +$defs: + severity: + description: Severity indicates the seriousness of a log entry + type: integer diff --git a/pkg/stanza/fileconsumer/attrs/config.schema.yaml b/pkg/stanza/fileconsumer/attrs/config.schema.yaml new file mode 100644 index 0000000000000..1b5618264eff5 --- /dev/null +++ b/pkg/stanza/fileconsumer/attrs/config.schema.yaml @@ -0,0 +1,16 @@ +$defs: + resolver: + type: object + properties: + include_file_name: + type: boolean + include_file_name_resolved: + type: boolean + include_file_owner_group_name: + type: boolean + include_file_owner_name: + type: boolean + include_file_path: + type: boolean + include_file_path_resolved: + type: boolean diff --git a/pkg/stanza/fileconsumer/config.schema.yaml b/pkg/stanza/fileconsumer/config.schema.yaml new file mode 100644 index 0000000000000..112ed846b4bcd --- /dev/null +++ b/pkg/stanza/fileconsumer/config.schema.yaml @@ -0,0 +1,55 @@ +$defs: + config: + description: Config is the configuration of a file input operator + type: object + properties: + acquire_fs_lock: + type: boolean + compression: + type: string + delete_after_read: + type: boolean + encoding: + type: string + fingerprint_size: + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper.byte_size + force_flush_period: + type: string + format: duration + header: + x-pointer: true + $ref: header_config + include_file_record_number: + type: boolean + include_file_record_offset: + type: boolean + initial_buffer_size: + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper.byte_size + max_batches: + type: integer + max_concurrent_files: + type: integer + max_log_size: + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper.byte_size + multiline: + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/split.config + poll_interval: + type: string + format: duration + polls_to_archive: + type: integer + start_at: + type: string + allOf: + - $ref: ./matcher.criteria + - $ref: ./attrs.resolver + - $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/trim.config + header_config: + type: object + properties: + metadata_operators: + type: array + items: + x-customType: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator.Config + pattern: + type: string diff --git a/pkg/stanza/fileconsumer/matcher/config.schema.yaml b/pkg/stanza/fileconsumer/matcher/config.schema.yaml new file mode 100644 index 0000000000000..b6047089a5264 --- /dev/null +++ b/pkg/stanza/fileconsumer/matcher/config.schema.yaml @@ -0,0 +1,45 @@ +$defs: + criteria: + type: object + properties: + exclude: + type: array + items: + type: string + exclude_older_than: + description: ExcludeOlderThan allows excluding files whose modification time is older than the specified age. + type: string + format: duration + include: + type: array + items: + type: string + ordering_criteria: + $ref: ordering_criteria + ordering_criteria: + type: object + properties: + group_by: + type: string + regex: + type: string + sort_by: + type: array + items: + $ref: sort + top_n: + type: integer + sort: + type: object + properties: + ascending: + type: boolean + layout: + description: Timestamp only + type: string + location: + type: string + regex_key: + type: string + sort_type: + type: string diff --git a/pkg/stanza/operator/config.schema.yaml b/pkg/stanza/operator/config.schema.yaml new file mode 100644 index 0000000000000..0967ef424bce6 --- /dev/null +++ b/pkg/stanza/operator/config.schema.yaml @@ -0,0 +1 @@ +{} diff --git a/pkg/stanza/operator/helper/config.schema.yaml b/pkg/stanza/operator/helper/config.schema.yaml new file mode 100644 index 0000000000000..5e0ae4fcebc84 --- /dev/null +++ b/pkg/stanza/operator/helper/config.schema.yaml @@ -0,0 +1,153 @@ +$defs: + attributer_config: + description: AttributerConfig is the configuration of a attributer + type: object + properties: + attributes: + type: object + additionalProperties: + $ref: expr_string_config + basic_config: + description: BasicConfig provides a basic implemention for an operator config. + type: object + properties: + id: + type: string + type: + type: string + byte_size: + type: integer + x-customType: int64 + expr_string_config: + description: ExprStringConfig is a string that represents an expression + type: string + identifier_config: + description: IdentifierConfig is the configuration of a resource identifier + type: object + properties: + resource: + type: object + additionalProperties: + $ref: expr_string_config + input_config: + description: InputConfig provides a basic implementation of an input operator config. + type: object + allOf: + - $ref: attributer_config + - $ref: identifier_config + - $ref: writer_config + output_config: + description: OutputConfig provides a basic implementation of an output operator config. + type: object + allOf: + - $ref: basic_config + parser_config: + description: ParserConfig provides the basic implementation of a parser config. + type: object + properties: + body: + x-pointer: true + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field + parse_from: + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field + parse_to: + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.rootable_field + scope_name: + x-pointer: true + $ref: scope_name_parser + severity: + x-pointer: true + $ref: severity_config + timestamp: + x-pointer: true + $ref: time_parser + trace: + x-pointer: true + $ref: trace_parser + allOf: + - $ref: transformer_config + scope_name_parser: + description: ScopeNameParser is a helper that parses severity onto an entry. + type: object + properties: + parse_from: + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field + severity_config: + description: SeverityConfig allows users to specify how to parse a severity from a field. + type: object + properties: + mapping: + type: object + additionalProperties: + x-customType: any + overwrite_text: + type: boolean + parse_from: + x-pointer: true + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field + preset: + type: string + span_id_config: + type: object + properties: + parse_from: + x-pointer: true + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field + time_parser: + description: TimeParser is a helper that parses time onto an entry. + type: object + properties: + layout: + type: string + layout_type: + type: string + location: + type: string + parse_from: + x-pointer: true + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field + trace_flags_config: + type: object + properties: + parse_from: + x-pointer: true + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field + trace_id_config: + type: object + properties: + parse_from: + x-pointer: true + $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/entry.field + trace_parser: + description: TraceParser is a helper that parses trace spans (and flags) onto an entry. + type: object + properties: + span_id: + x-pointer: true + $ref: span_id_config + trace_flags: + x-pointer: true + $ref: trace_flags_config + trace_id: + x-pointer: true + $ref: trace_id_config + transformer_config: + description: TransformerConfig provides a basic implementation of a transformer config. + type: object + properties: + if: + type: string + on_error: + type: string + allOf: + - $ref: writer_config + writer_config: + description: WriterConfig is the configuration of a writer operator. + type: object + properties: + output: + type: array + items: + type: string + allOf: + - $ref: basic_config diff --git a/pkg/stanza/operator/input/file/config.schema.yaml b/pkg/stanza/operator/input/file/config.schema.yaml new file mode 100644 index 0000000000000..e0da30fd52c08 --- /dev/null +++ b/pkg/stanza/operator/input/file/config.schema.yaml @@ -0,0 +1,7 @@ +$defs: + config: + description: Config is the configuration of a file input operator + type: object + allOf: + - $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/helper.input_config + - $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/fileconsumer.config diff --git a/pkg/stanza/split/config.schema.yaml b/pkg/stanza/split/config.schema.yaml new file mode 100644 index 0000000000000..f2601ef8099d8 --- /dev/null +++ b/pkg/stanza/split/config.schema.yaml @@ -0,0 +1,11 @@ +$defs: + config: + description: Config is the configuration for a split func + type: object + properties: + line_end_pattern: + type: string + line_start_pattern: + type: string + omit_pattern: + type: boolean diff --git a/pkg/stanza/trim/config.schema.yaml b/pkg/stanza/trim/config.schema.yaml new file mode 100644 index 0000000000000..bfcaa22253111 --- /dev/null +++ b/pkg/stanza/trim/config.schema.yaml @@ -0,0 +1,8 @@ +$defs: + config: + type: object + properties: + preserve_leading_whitespaces: + type: boolean + preserve_trailing_whitespaces: + type: boolean diff --git a/receiver/elasticsearchreceiver/config.schema.yaml b/receiver/elasticsearchreceiver/config.schema.yaml new file mode 100644 index 0000000000000..56c6cb6908ad6 --- /dev/null +++ b/receiver/elasticsearchreceiver/config.schema.yaml @@ -0,0 +1,26 @@ +description: Config is the configuration for the elasticsearch receiver +type: object +properties: + indices: + description: Indices defines the indices to scrape. See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html#index-stats-api-path-params for which names are viable. If Indices is empty, no indices will be scraped. + type: array + items: + type: string + nodes: + description: Nodes defines the nodes to scrape. See https://www.elastic.co/guide/en/elasticsearch/reference/7.9/cluster.html#cluster-nodes for which selectors may be used here. If Nodes is empty, no nodes will be scraped. + type: array + items: + type: string + password: + description: Password is the password used when making REST calls to elasticsearch. Must be specified if Username is. Not required. + $ref: go.opentelemetry.io/collector/config/configopaque.string + skip_cluster_metrics: + description: SkipClusterMetrics indicates whether cluster level metrics from /_cluster/* endpoints should be scraped or not. + type: boolean + username: + description: Username is the username used when making REST calls to elasticsearch. Must be specified if Password is. Not required. + type: string +allOf: + - $ref: go.opentelemetry.io/collector/scraper/scraperhelper.controller_config + - $ref: go.opentelemetry.io/collector/config/confighttp.client_config + - $ref: ./internal/metadata.metrics_builder_config diff --git a/receiver/elasticsearchreceiver/internal/metadata/config.schema.yaml b/receiver/elasticsearchreceiver/internal/metadata/config.schema.yaml new file mode 100644 index 0000000000000..2e6b0e70728b5 --- /dev/null +++ b/receiver/elasticsearchreceiver/internal/metadata/config.schema.yaml @@ -0,0 +1,282 @@ +$defs: + attribute_cache_name: + description: AttributeCacheName specifies the value cache_name attribute. + type: integer + attribute_cluster_published_difference_state: + description: AttributeClusterPublishedDifferenceState specifies the value cluster_published_difference_state attribute. + type: integer + attribute_cluster_state_queue_state: + description: AttributeClusterStateQueueState specifies the value cluster_state_queue_state attribute. + type: integer + attribute_cluster_state_update_type: + description: AttributeClusterStateUpdateType specifies the value cluster_state_update_type attribute. + type: integer + attribute_direction: + description: AttributeDirection specifies the value direction attribute. + type: integer + attribute_document_state: + description: AttributeDocumentState specifies the value document_state attribute. + type: integer + attribute_get_result: + description: AttributeGetResult specifies the value get_result attribute. + type: integer + attribute_health_status: + description: AttributeHealthStatus specifies the value health_status attribute. + type: integer + attribute_index_aggregation_type: + description: AttributeIndexAggregationType specifies the value index_aggregation_type attribute. + type: integer + attribute_indexing_pressure_stage: + description: AttributeIndexingPressureStage specifies the value indexing_pressure_stage attribute. + type: integer + attribute_memory_state: + description: AttributeMemoryState specifies the value memory_state attribute. + type: integer + attribute_operation: + description: AttributeOperation specifies the value operation attribute. + type: integer + attribute_query_cache_count_type: + description: AttributeQueryCacheCountType specifies the value query_cache_count_type attribute. + type: integer + attribute_segments_memory_object_type: + description: AttributeSegmentsMemoryObjectType specifies the value segments_memory_object_type attribute. + type: integer + attribute_shard_state: + description: AttributeShardState specifies the value shard_state attribute. + type: integer + attribute_task_state: + description: AttributeTaskState specifies the value task_state attribute. + type: integer + attribute_thread_state: + description: AttributeThreadState specifies the value thread_state attribute. + type: integer + metric_config: + description: MetricConfig provides common config for a particular metric. + type: object + properties: + enabled: + type: boolean + metrics_builder_config: + description: MetricsBuilderConfig is a configuration for elasticsearch metrics builder. + type: object + properties: + metrics: + $ref: metrics_config + resource_attributes: + $ref: resource_attributes_config + metrics_config: + description: MetricsConfig provides config for elasticsearch metrics. + type: object + properties: + elasticsearch.breaker.memory.estimated: + $ref: metric_config + elasticsearch.breaker.memory.limit: + $ref: metric_config + elasticsearch.breaker.tripped: + $ref: metric_config + elasticsearch.cluster.data_nodes: + $ref: metric_config + elasticsearch.cluster.health: + $ref: metric_config + elasticsearch.cluster.in_flight_fetch: + $ref: metric_config + elasticsearch.cluster.indices.cache.evictions: + $ref: metric_config + elasticsearch.cluster.nodes: + $ref: metric_config + elasticsearch.cluster.pending_tasks: + $ref: metric_config + elasticsearch.cluster.published_states.differences: + $ref: metric_config + elasticsearch.cluster.published_states.full: + $ref: metric_config + elasticsearch.cluster.shards: + $ref: metric_config + elasticsearch.cluster.state_queue: + $ref: metric_config + elasticsearch.cluster.state_update.count: + $ref: metric_config + elasticsearch.cluster.state_update.time: + $ref: metric_config + elasticsearch.index.cache.evictions: + $ref: metric_config + elasticsearch.index.cache.memory.usage: + $ref: metric_config + elasticsearch.index.cache.size: + $ref: metric_config + elasticsearch.index.documents: + $ref: metric_config + elasticsearch.index.operations.completed: + $ref: metric_config + elasticsearch.index.operations.merge.current: + $ref: metric_config + elasticsearch.index.operations.merge.docs_count: + $ref: metric_config + elasticsearch.index.operations.merge.size: + $ref: metric_config + elasticsearch.index.operations.time: + $ref: metric_config + elasticsearch.index.segments.count: + $ref: metric_config + elasticsearch.index.segments.memory: + $ref: metric_config + elasticsearch.index.segments.size: + $ref: metric_config + elasticsearch.index.shards.size: + $ref: metric_config + elasticsearch.index.translog.operations: + $ref: metric_config + elasticsearch.index.translog.size: + $ref: metric_config + elasticsearch.indexing_pressure.memory.limit: + $ref: metric_config + elasticsearch.indexing_pressure.memory.total.primary_rejections: + $ref: metric_config + elasticsearch.indexing_pressure.memory.total.replica_rejections: + $ref: metric_config + elasticsearch.memory.indexing_pressure: + $ref: metric_config + elasticsearch.node.cache.count: + $ref: metric_config + elasticsearch.node.cache.evictions: + $ref: metric_config + elasticsearch.node.cache.memory.usage: + $ref: metric_config + elasticsearch.node.cache.size: + $ref: metric_config + elasticsearch.node.cluster.connections: + $ref: metric_config + elasticsearch.node.cluster.io: + $ref: metric_config + elasticsearch.node.disk.io.read: + $ref: metric_config + elasticsearch.node.disk.io.write: + $ref: metric_config + elasticsearch.node.documents: + $ref: metric_config + elasticsearch.node.fs.disk.available: + $ref: metric_config + elasticsearch.node.fs.disk.free: + $ref: metric_config + elasticsearch.node.fs.disk.total: + $ref: metric_config + elasticsearch.node.http.connections: + $ref: metric_config + elasticsearch.node.ingest.documents: + $ref: metric_config + elasticsearch.node.ingest.documents.current: + $ref: metric_config + elasticsearch.node.ingest.operations.failed: + $ref: metric_config + elasticsearch.node.open_files: + $ref: metric_config + elasticsearch.node.operations.completed: + $ref: metric_config + elasticsearch.node.operations.current: + $ref: metric_config + elasticsearch.node.operations.get.completed: + $ref: metric_config + elasticsearch.node.operations.get.time: + $ref: metric_config + elasticsearch.node.operations.time: + $ref: metric_config + elasticsearch.node.pipeline.ingest.documents.current: + $ref: metric_config + elasticsearch.node.pipeline.ingest.documents.preprocessed: + $ref: metric_config + elasticsearch.node.pipeline.ingest.operations.failed: + $ref: metric_config + elasticsearch.node.script.cache_evictions: + $ref: metric_config + elasticsearch.node.script.compilation_limit_triggered: + $ref: metric_config + elasticsearch.node.script.compilations: + $ref: metric_config + elasticsearch.node.segments.memory: + $ref: metric_config + elasticsearch.node.shards.data_set.size: + $ref: metric_config + elasticsearch.node.shards.reserved.size: + $ref: metric_config + elasticsearch.node.shards.size: + $ref: metric_config + elasticsearch.node.thread_pool.tasks.finished: + $ref: metric_config + elasticsearch.node.thread_pool.tasks.queued: + $ref: metric_config + elasticsearch.node.thread_pool.threads: + $ref: metric_config + elasticsearch.node.translog.operations: + $ref: metric_config + elasticsearch.node.translog.size: + $ref: metric_config + elasticsearch.node.translog.uncommitted.size: + $ref: metric_config + elasticsearch.os.cpu.load_avg.1m: + $ref: metric_config + elasticsearch.os.cpu.load_avg.5m: + $ref: metric_config + elasticsearch.os.cpu.load_avg.15m: + $ref: metric_config + elasticsearch.os.cpu.usage: + $ref: metric_config + elasticsearch.os.memory: + $ref: metric_config + elasticsearch.process.cpu.time: + $ref: metric_config + elasticsearch.process.cpu.usage: + $ref: metric_config + elasticsearch.process.memory.virtual: + $ref: metric_config + jvm.classes.loaded: + $ref: metric_config + jvm.gc.collections.count: + $ref: metric_config + jvm.gc.collections.elapsed: + $ref: metric_config + jvm.memory.heap.committed: + $ref: metric_config + jvm.memory.heap.max: + $ref: metric_config + jvm.memory.heap.used: + $ref: metric_config + jvm.memory.heap.utilization: + $ref: metric_config + jvm.memory.nonheap.committed: + $ref: metric_config + jvm.memory.nonheap.used: + $ref: metric_config + jvm.memory.pool.max: + $ref: metric_config + jvm.memory.pool.used: + $ref: metric_config + jvm.threads.count: + $ref: metric_config + resource_attribute_config: + description: ResourceAttributeConfig provides common config for a particular resource attribute. + type: object + properties: + enabled: + type: boolean + metrics_exclude: + description: 'Experimental: MetricsExclude defines a list of filters for attribute values. If the list is not empty, metrics with matching resource attribute values will not be emitted. MetricsInclude has higher priority than MetricsExclude.' + type: array + items: + $ref: go.opentelemetry.io/collector/filter.config + metrics_include: + description: 'Experimental: MetricsInclude defines a list of filters for attribute values. If the list is not empty, only metrics with matching resource attribute values will be emitted.' + type: array + items: + $ref: go.opentelemetry.io/collector/filter.config + resource_attributes_config: + description: ResourceAttributesConfig provides config for elasticsearch resource attributes. + type: object + properties: + elasticsearch.cluster.name: + $ref: resource_attribute_config + elasticsearch.index.name: + $ref: resource_attribute_config + elasticsearch.node.name: + $ref: resource_attribute_config + elasticsearch.node.version: + $ref: resource_attribute_config diff --git a/receiver/envoyalsreceiver/config.schema.yaml b/receiver/envoyalsreceiver/config.schema.yaml new file mode 100644 index 0000000000000..913940b11d544 --- /dev/null +++ b/receiver/envoyalsreceiver/config.schema.yaml @@ -0,0 +1,3 @@ +type: object +allOf: + - $ref: go.opentelemetry.io/collector/config/configgrpc.server_config diff --git a/receiver/expvarreceiver/config.schema.yaml b/receiver/expvarreceiver/config.schema.yaml new file mode 100644 index 0000000000000..bad4c9f6963b5 --- /dev/null +++ b/receiver/expvarreceiver/config.schema.yaml @@ -0,0 +1,5 @@ +type: object +allOf: + - $ref: go.opentelemetry.io/collector/scraper/scraperhelper.controller_config + - $ref: go.opentelemetry.io/collector/config/confighttp.client_config + - $ref: ./internal/metadata.metrics_builder_config diff --git a/receiver/expvarreceiver/internal/metadata/config.schema.yaml b/receiver/expvarreceiver/internal/metadata/config.schema.yaml new file mode 100644 index 0000000000000..30bf79be9fc91 --- /dev/null +++ b/receiver/expvarreceiver/internal/metadata/config.schema.yaml @@ -0,0 +1,69 @@ +$defs: + metric_config: + description: MetricConfig provides common config for a particular metric. + type: object + properties: + enabled: + type: boolean + metrics_builder_config: + description: MetricsBuilderConfig is a configuration for expvar metrics builder. + type: object + properties: + metrics: + $ref: metrics_config + metrics_config: + description: MetricsConfig provides config for expvar metrics. + type: object + properties: + process.runtime.memstats.buck_hash_sys: + $ref: metric_config + process.runtime.memstats.frees: + $ref: metric_config + process.runtime.memstats.gc_cpu_fraction: + $ref: metric_config + process.runtime.memstats.gc_sys: + $ref: metric_config + process.runtime.memstats.heap_alloc: + $ref: metric_config + process.runtime.memstats.heap_idle: + $ref: metric_config + process.runtime.memstats.heap_inuse: + $ref: metric_config + process.runtime.memstats.heap_objects: + $ref: metric_config + process.runtime.memstats.heap_released: + $ref: metric_config + process.runtime.memstats.heap_sys: + $ref: metric_config + process.runtime.memstats.last_pause: + $ref: metric_config + process.runtime.memstats.lookups: + $ref: metric_config + process.runtime.memstats.mallocs: + $ref: metric_config + process.runtime.memstats.mcache_inuse: + $ref: metric_config + process.runtime.memstats.mcache_sys: + $ref: metric_config + process.runtime.memstats.mspan_inuse: + $ref: metric_config + process.runtime.memstats.mspan_sys: + $ref: metric_config + process.runtime.memstats.next_gc: + $ref: metric_config + process.runtime.memstats.num_forced_gc: + $ref: metric_config + process.runtime.memstats.num_gc: + $ref: metric_config + process.runtime.memstats.other_sys: + $ref: metric_config + process.runtime.memstats.pause_total: + $ref: metric_config + process.runtime.memstats.stack_inuse: + $ref: metric_config + process.runtime.memstats.stack_sys: + $ref: metric_config + process.runtime.memstats.sys: + $ref: metric_config + process.runtime.memstats.total_alloc: + $ref: metric_config diff --git a/receiver/faroreceiver/config.schema.yaml b/receiver/faroreceiver/config.schema.yaml new file mode 100644 index 0000000000000..a7815ec1dc960 --- /dev/null +++ b/receiver/faroreceiver/config.schema.yaml @@ -0,0 +1,3 @@ +type: object +allOf: + - $ref: go.opentelemetry.io/collector/config/confighttp.server_config diff --git a/receiver/filelogreceiver/config.schema.yaml b/receiver/filelogreceiver/config.schema.yaml new file mode 100644 index 0000000000000..09429996246b2 --- /dev/null +++ b/receiver/filelogreceiver/config.schema.yaml @@ -0,0 +1,5 @@ +description: FileLogConfig defines configuration for the filelog receiver +type: object +allOf: + - $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/operator/input/file.config + - $ref: github.com/open-telemetry/opentelemetry-collector-contrib/pkg/stanza/adapter.base_config diff --git a/receiver/filestatsreceiver/config.schema.yaml b/receiver/filestatsreceiver/config.schema.yaml new file mode 100644 index 0000000000000..2234a4fcce490 --- /dev/null +++ b/receiver/filestatsreceiver/config.schema.yaml @@ -0,0 +1,7 @@ +type: object +properties: + include: + type: string +allOf: + - $ref: go.opentelemetry.io/collector/scraper/scraperhelper.controller_config + - $ref: ./internal/metadata.metrics_builder_config diff --git a/receiver/filestatsreceiver/internal/metadata/config.schema.yaml b/receiver/filestatsreceiver/internal/metadata/config.schema.yaml new file mode 100644 index 0000000000000..62aed53080ea8 --- /dev/null +++ b/receiver/filestatsreceiver/internal/metadata/config.schema.yaml @@ -0,0 +1,53 @@ +$defs: + metric_config: + description: MetricConfig provides common config for a particular metric. + type: object + properties: + enabled: + type: boolean + metrics_builder_config: + description: MetricsBuilderConfig is a configuration for filestats metrics builder. + type: object + properties: + metrics: + $ref: metrics_config + resource_attributes: + $ref: resource_attributes_config + metrics_config: + description: MetricsConfig provides config for filestats metrics. + type: object + properties: + file.atime: + $ref: metric_config + file.count: + $ref: metric_config + file.ctime: + $ref: metric_config + file.mtime: + $ref: metric_config + file.size: + $ref: metric_config + resource_attribute_config: + description: ResourceAttributeConfig provides common config for a particular resource attribute. + type: object + properties: + enabled: + type: boolean + metrics_exclude: + description: 'Experimental: MetricsExclude defines a list of filters for attribute values. If the list is not empty, metrics with matching resource attribute values will not be emitted. MetricsInclude has higher priority than MetricsExclude.' + type: array + items: + $ref: go.opentelemetry.io/collector/filter.config + metrics_include: + description: 'Experimental: MetricsInclude defines a list of filters for attribute values. If the list is not empty, only metrics with matching resource attribute values will be emitted.' + type: array + items: + $ref: go.opentelemetry.io/collector/filter.config + resource_attributes_config: + description: ResourceAttributesConfig provides config for filestats resource attributes. + type: object + properties: + file.name: + $ref: resource_attribute_config + file.path: + $ref: resource_attribute_config diff --git a/receiver/flinkmetricsreceiver/config.schema.yaml b/receiver/flinkmetricsreceiver/config.schema.yaml new file mode 100644 index 0000000000000..8e4a506fe1e26 --- /dev/null +++ b/receiver/flinkmetricsreceiver/config.schema.yaml @@ -0,0 +1,6 @@ +description: Config defines the configuration for the various elements of the receiver agent. +type: object +allOf: + - $ref: go.opentelemetry.io/collector/scraper/scraperhelper.controller_config + - $ref: go.opentelemetry.io/collector/config/confighttp.client_config + - $ref: ./internal/metadata.metrics_builder_config diff --git a/receiver/flinkmetricsreceiver/internal/metadata/config.schema.yaml b/receiver/flinkmetricsreceiver/internal/metadata/config.schema.yaml new file mode 100644 index 0000000000000..4f46fa154da03 --- /dev/null +++ b/receiver/flinkmetricsreceiver/internal/metadata/config.schema.yaml @@ -0,0 +1,118 @@ +$defs: + attribute_checkpoint: + description: AttributeCheckpoint specifies the value checkpoint attribute. + type: integer + attribute_garbage_collector_name: + description: AttributeGarbageCollectorName specifies the value garbage_collector_name attribute. + type: integer + attribute_record: + description: AttributeRecord specifies the value record attribute. + type: integer + metric_config: + description: MetricConfig provides common config for a particular metric. + type: object + properties: + enabled: + type: boolean + metrics_builder_config: + description: MetricsBuilderConfig is a configuration for flinkmetrics metrics builder. + type: object + properties: + metrics: + $ref: metrics_config + resource_attributes: + $ref: resource_attributes_config + metrics_config: + description: MetricsConfig provides config for flinkmetrics metrics. + type: object + properties: + flink.job.checkpoint.count: + $ref: metric_config + flink.job.checkpoint.in_progress: + $ref: metric_config + flink.job.last_checkpoint.size: + $ref: metric_config + flink.job.last_checkpoint.time: + $ref: metric_config + flink.job.restart.count: + $ref: metric_config + flink.jvm.class_loader.classes_loaded: + $ref: metric_config + flink.jvm.cpu.load: + $ref: metric_config + flink.jvm.cpu.time: + $ref: metric_config + flink.jvm.gc.collections.count: + $ref: metric_config + flink.jvm.gc.collections.time: + $ref: metric_config + flink.jvm.memory.direct.total_capacity: + $ref: metric_config + flink.jvm.memory.direct.used: + $ref: metric_config + flink.jvm.memory.heap.committed: + $ref: metric_config + flink.jvm.memory.heap.max: + $ref: metric_config + flink.jvm.memory.heap.used: + $ref: metric_config + flink.jvm.memory.mapped.total_capacity: + $ref: metric_config + flink.jvm.memory.mapped.used: + $ref: metric_config + flink.jvm.memory.metaspace.committed: + $ref: metric_config + flink.jvm.memory.metaspace.max: + $ref: metric_config + flink.jvm.memory.metaspace.used: + $ref: metric_config + flink.jvm.memory.nonheap.committed: + $ref: metric_config + flink.jvm.memory.nonheap.max: + $ref: metric_config + flink.jvm.memory.nonheap.used: + $ref: metric_config + flink.jvm.threads.count: + $ref: metric_config + flink.memory.managed.total: + $ref: metric_config + flink.memory.managed.used: + $ref: metric_config + flink.operator.record.count: + $ref: metric_config + flink.operator.watermark.output: + $ref: metric_config + flink.task.record.count: + $ref: metric_config + resource_attribute_config: + description: ResourceAttributeConfig provides common config for a particular resource attribute. + type: object + properties: + enabled: + type: boolean + metrics_exclude: + description: 'Experimental: MetricsExclude defines a list of filters for attribute values. If the list is not empty, metrics with matching resource attribute values will not be emitted. MetricsInclude has higher priority than MetricsExclude.' + type: array + items: + $ref: go.opentelemetry.io/collector/filter.config + metrics_include: + description: 'Experimental: MetricsInclude defines a list of filters for attribute values. If the list is not empty, only metrics with matching resource attribute values will be emitted.' + type: array + items: + $ref: go.opentelemetry.io/collector/filter.config + resource_attributes_config: + description: ResourceAttributesConfig provides config for flinkmetrics resource attributes. + type: object + properties: + flink.job.name: + $ref: resource_attribute_config + flink.resource.type: + $ref: resource_attribute_config + flink.subtask.index: + $ref: resource_attribute_config + flink.task.name: + $ref: resource_attribute_config + flink.taskmanager.id: + $ref: resource_attribute_config + host.name: + $ref: resource_attribute_config diff --git a/receiver/fluentforwardreceiver/config.schema.yaml b/receiver/fluentforwardreceiver/config.schema.yaml new file mode 100644 index 0000000000000..ceeab35d5262f --- /dev/null +++ b/receiver/fluentforwardreceiver/config.schema.yaml @@ -0,0 +1,6 @@ +description: Config defines configuration for the fluentforward receiver. +type: object +properties: + endpoint: + description: The address to listen on for incoming Fluent Forward events. Should be of the form `:` (TCP) or `unix://` (Unix domain socket). + type: string diff --git a/receiver/githubreceiver/config.schema.yaml b/receiver/githubreceiver/config.schema.yaml new file mode 100644 index 0000000000000..a6b669f8fad44 --- /dev/null +++ b/receiver/githubreceiver/config.schema.yaml @@ -0,0 +1,44 @@ +$defs: + git_hub_headers: + type: object + properties: + Customizable: + type: object + additionalProperties: + type: string + Fixed: + type: object + additionalProperties: + type: string + web_hook: + type: object + properties: + health_path: + type: string + include_span_events: + type: boolean + path: + type: string + required_headers: + type: object + additionalProperties: + $ref: go.opentelemetry.io/collector/config/configopaque.string + secret: + type: string + service_name: + type: string + allOf: + - $ref: go.opentelemetry.io/collector/config/confighttp.server_config + - $ref: git_hub_headers +description: Config that is exposed to this github receiver through the OTEL config.yaml +type: object +properties: + scrapers: + type: object + additionalProperties: + $ref: ./internal.config + webhook: + $ref: web_hook +allOf: + - $ref: go.opentelemetry.io/collector/scraper/scraperhelper.controller_config + - $ref: ./internal/metadata.metrics_builder_config diff --git a/receiver/githubreceiver/internal/config.schema.yaml b/receiver/githubreceiver/internal/config.schema.yaml new file mode 100644 index 0000000000000..5e751acf8571b --- /dev/null +++ b/receiver/githubreceiver/internal/config.schema.yaml @@ -0,0 +1,3 @@ +$defs: + config: + x-customType: any diff --git a/receiver/githubreceiver/internal/metadata/config.schema.yaml b/receiver/githubreceiver/internal/metadata/config.schema.yaml new file mode 100644 index 0000000000000..c47c2f9730224 --- /dev/null +++ b/receiver/githubreceiver/internal/metadata/config.schema.yaml @@ -0,0 +1,81 @@ +$defs: + attribute_vcs_change_state: + description: AttributeVcsChangeState specifies the value vcs.change.state attribute. + type: integer + attribute_vcs_line_change_type: + description: AttributeVcsLineChangeType specifies the value vcs.line_change.type attribute. + type: integer + attribute_vcs_ref_base_type: + description: AttributeVcsRefBaseType specifies the value vcs.ref.base.type attribute. + type: integer + attribute_vcs_ref_head_type: + description: AttributeVcsRefHeadType specifies the value vcs.ref.head.type attribute. + type: integer + attribute_vcs_ref_type: + description: AttributeVcsRefType specifies the value vcs.ref.type attribute. + type: integer + attribute_vcs_revision_delta_direction: + description: AttributeVcsRevisionDeltaDirection specifies the value vcs.revision_delta.direction attribute. + type: integer + metric_config: + description: MetricConfig provides common config for a particular metric. + type: object + properties: + enabled: + type: boolean + metrics_builder_config: + description: MetricsBuilderConfig is a configuration for github metrics builder. + type: object + properties: + metrics: + $ref: metrics_config + resource_attributes: + $ref: resource_attributes_config + metrics_config: + description: MetricsConfig provides config for github metrics. + type: object + properties: + vcs.change.count: + $ref: metric_config + vcs.change.duration: + $ref: metric_config + vcs.change.time_to_approval: + $ref: metric_config + vcs.change.time_to_merge: + $ref: metric_config + vcs.contributor.count: + $ref: metric_config + vcs.ref.count: + $ref: metric_config + vcs.ref.lines_delta: + $ref: metric_config + vcs.ref.revisions_delta: + $ref: metric_config + vcs.ref.time: + $ref: metric_config + vcs.repository.count: + $ref: metric_config + resource_attribute_config: + description: ResourceAttributeConfig provides common config for a particular resource attribute. + type: object + properties: + enabled: + type: boolean + metrics_exclude: + description: 'Experimental: MetricsExclude defines a list of filters for attribute values. If the list is not empty, metrics with matching resource attribute values will not be emitted. MetricsInclude has higher priority than MetricsExclude.' + type: array + items: + $ref: go.opentelemetry.io/collector/filter.config + metrics_include: + description: 'Experimental: MetricsInclude defines a list of filters for attribute values. If the list is not empty, only metrics with matching resource attribute values will be emitted.' + type: array + items: + $ref: go.opentelemetry.io/collector/filter.config + resource_attributes_config: + description: ResourceAttributesConfig provides config for github resource attributes. + type: object + properties: + vcs.owner.name: + $ref: resource_attribute_config + vcs.provider.name: + $ref: resource_attribute_config diff --git a/receiver/gitlabreceiver/config.schema.yaml b/receiver/gitlabreceiver/config.schema.yaml new file mode 100644 index 0000000000000..1523979e00ee8 --- /dev/null +++ b/receiver/gitlabreceiver/config.schema.yaml @@ -0,0 +1,36 @@ +$defs: + gitlab_headers: + type: object + properties: + Customizable: + type: object + additionalProperties: + type: string + Fixed: + type: object + additionalProperties: + type: string + web_hook: + type: object + properties: + health_path: + type: string + include_user_attributes: + description: 'IncludeUserAttributes controls whether user information (commit author, pipeline actor) is included Default: false (user information is excluded by default for privacy)' + type: boolean + path: + type: string + required_headers: + type: object + additionalProperties: + $ref: go.opentelemetry.io/collector/config/configopaque.string + secret: + type: string + allOf: + - $ref: go.opentelemetry.io/collector/config/confighttp.server_config + - $ref: gitlab_headers +description: Config that is exposed to this gitlab receiver through the OTEL config.yaml +type: object +properties: + webhook: + $ref: web_hook