generated_config.go 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. // Code generated by mdatagen. DO NOT EDIT.
  2. package metadata
  3. import "go.opentelemetry.io/collector/confmap"
  4. // MetricConfig provides common config for a particular metric.
  5. type MetricConfig struct {
  6. Enabled bool `mapstructure:"enabled"`
  7. enabledSetByUser bool
  8. }
  9. func (ms *MetricConfig) Unmarshal(parser *confmap.Conf) error {
  10. if parser == nil {
  11. return nil
  12. }
  13. err := parser.Unmarshal(ms, confmap.WithErrorUnused())
  14. if err != nil {
  15. return err
  16. }
  17. ms.enabledSetByUser = parser.IsSet("enabled")
  18. return nil
  19. }
  20. // MetricsConfig provides config for oracledb metrics.
  21. type MetricsConfig struct {
  22. OracledbConsistentGets MetricConfig `mapstructure:"oracledb.consistent_gets"`
  23. OracledbCPUTime MetricConfig `mapstructure:"oracledb.cpu_time"`
  24. OracledbDbBlockGets MetricConfig `mapstructure:"oracledb.db_block_gets"`
  25. OracledbDmlLocksLimit MetricConfig `mapstructure:"oracledb.dml_locks.limit"`
  26. OracledbDmlLocksUsage MetricConfig `mapstructure:"oracledb.dml_locks.usage"`
  27. OracledbEnqueueDeadlocks MetricConfig `mapstructure:"oracledb.enqueue_deadlocks"`
  28. OracledbEnqueueLocksLimit MetricConfig `mapstructure:"oracledb.enqueue_locks.limit"`
  29. OracledbEnqueueLocksUsage MetricConfig `mapstructure:"oracledb.enqueue_locks.usage"`
  30. OracledbEnqueueResourcesLimit MetricConfig `mapstructure:"oracledb.enqueue_resources.limit"`
  31. OracledbEnqueueResourcesUsage MetricConfig `mapstructure:"oracledb.enqueue_resources.usage"`
  32. OracledbExchangeDeadlocks MetricConfig `mapstructure:"oracledb.exchange_deadlocks"`
  33. OracledbExecutions MetricConfig `mapstructure:"oracledb.executions"`
  34. OracledbHardParses MetricConfig `mapstructure:"oracledb.hard_parses"`
  35. OracledbLogicalReads MetricConfig `mapstructure:"oracledb.logical_reads"`
  36. OracledbParseCalls MetricConfig `mapstructure:"oracledb.parse_calls"`
  37. OracledbPgaMemory MetricConfig `mapstructure:"oracledb.pga_memory"`
  38. OracledbPhysicalReads MetricConfig `mapstructure:"oracledb.physical_reads"`
  39. OracledbProcessesLimit MetricConfig `mapstructure:"oracledb.processes.limit"`
  40. OracledbProcessesUsage MetricConfig `mapstructure:"oracledb.processes.usage"`
  41. OracledbSessionsLimit MetricConfig `mapstructure:"oracledb.sessions.limit"`
  42. OracledbSessionsUsage MetricConfig `mapstructure:"oracledb.sessions.usage"`
  43. OracledbTablespaceSizeLimit MetricConfig `mapstructure:"oracledb.tablespace_size.limit"`
  44. OracledbTablespaceSizeUsage MetricConfig `mapstructure:"oracledb.tablespace_size.usage"`
  45. OracledbTransactionsLimit MetricConfig `mapstructure:"oracledb.transactions.limit"`
  46. OracledbTransactionsUsage MetricConfig `mapstructure:"oracledb.transactions.usage"`
  47. OracledbUserCommits MetricConfig `mapstructure:"oracledb.user_commits"`
  48. OracledbUserRollbacks MetricConfig `mapstructure:"oracledb.user_rollbacks"`
  49. }
  50. func DefaultMetricsConfig() MetricsConfig {
  51. return MetricsConfig{
  52. OracledbConsistentGets: MetricConfig{
  53. Enabled: false,
  54. },
  55. OracledbCPUTime: MetricConfig{
  56. Enabled: true,
  57. },
  58. OracledbDbBlockGets: MetricConfig{
  59. Enabled: false,
  60. },
  61. OracledbDmlLocksLimit: MetricConfig{
  62. Enabled: true,
  63. },
  64. OracledbDmlLocksUsage: MetricConfig{
  65. Enabled: true,
  66. },
  67. OracledbEnqueueDeadlocks: MetricConfig{
  68. Enabled: true,
  69. },
  70. OracledbEnqueueLocksLimit: MetricConfig{
  71. Enabled: true,
  72. },
  73. OracledbEnqueueLocksUsage: MetricConfig{
  74. Enabled: true,
  75. },
  76. OracledbEnqueueResourcesLimit: MetricConfig{
  77. Enabled: true,
  78. },
  79. OracledbEnqueueResourcesUsage: MetricConfig{
  80. Enabled: true,
  81. },
  82. OracledbExchangeDeadlocks: MetricConfig{
  83. Enabled: true,
  84. },
  85. OracledbExecutions: MetricConfig{
  86. Enabled: true,
  87. },
  88. OracledbHardParses: MetricConfig{
  89. Enabled: true,
  90. },
  91. OracledbLogicalReads: MetricConfig{
  92. Enabled: true,
  93. },
  94. OracledbParseCalls: MetricConfig{
  95. Enabled: true,
  96. },
  97. OracledbPgaMemory: MetricConfig{
  98. Enabled: true,
  99. },
  100. OracledbPhysicalReads: MetricConfig{
  101. Enabled: true,
  102. },
  103. OracledbProcessesLimit: MetricConfig{
  104. Enabled: true,
  105. },
  106. OracledbProcessesUsage: MetricConfig{
  107. Enabled: true,
  108. },
  109. OracledbSessionsLimit: MetricConfig{
  110. Enabled: true,
  111. },
  112. OracledbSessionsUsage: MetricConfig{
  113. Enabled: true,
  114. },
  115. OracledbTablespaceSizeLimit: MetricConfig{
  116. Enabled: true,
  117. },
  118. OracledbTablespaceSizeUsage: MetricConfig{
  119. Enabled: true,
  120. },
  121. OracledbTransactionsLimit: MetricConfig{
  122. Enabled: true,
  123. },
  124. OracledbTransactionsUsage: MetricConfig{
  125. Enabled: true,
  126. },
  127. OracledbUserCommits: MetricConfig{
  128. Enabled: true,
  129. },
  130. OracledbUserRollbacks: MetricConfig{
  131. Enabled: true,
  132. },
  133. }
  134. }
  135. // ResourceAttributeConfig provides common config for a particular resource attribute.
  136. type ResourceAttributeConfig struct {
  137. Enabled bool `mapstructure:"enabled"`
  138. enabledSetByUser bool
  139. }
  140. func (rac *ResourceAttributeConfig) Unmarshal(parser *confmap.Conf) error {
  141. if parser == nil {
  142. return nil
  143. }
  144. err := parser.Unmarshal(rac, confmap.WithErrorUnused())
  145. if err != nil {
  146. return err
  147. }
  148. rac.enabledSetByUser = parser.IsSet("enabled")
  149. return nil
  150. }
  151. // ResourceAttributesConfig provides config for oracledb resource attributes.
  152. type ResourceAttributesConfig struct {
  153. OracledbInstanceName ResourceAttributeConfig `mapstructure:"oracledb.instance.name"`
  154. }
  155. func DefaultResourceAttributesConfig() ResourceAttributesConfig {
  156. return ResourceAttributesConfig{
  157. OracledbInstanceName: ResourceAttributeConfig{
  158. Enabled: true,
  159. },
  160. }
  161. }
  162. // MetricsBuilderConfig is a configuration for oracledb metrics builder.
  163. type MetricsBuilderConfig struct {
  164. Metrics MetricsConfig `mapstructure:"metrics"`
  165. ResourceAttributes ResourceAttributesConfig `mapstructure:"resource_attributes"`
  166. }
  167. func DefaultMetricsBuilderConfig() MetricsBuilderConfig {
  168. return MetricsBuilderConfig{
  169. Metrics: DefaultMetricsConfig(),
  170. ResourceAttributes: DefaultResourceAttributesConfig(),
  171. }
  172. }