apiVersion: v1
kind: ConfigMap
metadata:
  name: oap-config
  namespace: skywalking
data:
  application.yml: |-
    cluster:
      # standalone:
      # Please check your ZooKeeper is 3.5+, However, it is also compatible with ZooKeeper 3.4.x. Replace the ZooKeeper 3.5+
      # library the oap-libs folder with your ZooKeeper 3.4.x library.
    #  zookeeper:
    #    nameSpace: ${SW_NAMESPACE:""}
    #    hostPort: ${SW_CLUSTER_ZK_HOST_PORT:localhost:2181}
    #    #Retry Policy
    #    baseSleepTimeMs: ${SW_CLUSTER_ZK_SLEEP_TIME:1000} # initial amount of time to wait between retries
    #    maxRetries: ${SW_CLUSTER_ZK_MAX_RETRIES:3} # max number of times to retry
      kubernetes:
        watchTimeoutSeconds: ${SW_CLUSTER_K8S_WATCH_TIMEOUT:60}
        namespace: ${SW_CLUSTER_K8S_NAMESPACE:skywalking}   #注意这里名称空间哦
        labelSelector: ${SW_CLUSTER_K8S_LABEL:app=oap,release=skywalking}
        uidEnvName: ${SW_CLUSTER_K8S_UID:SKYWALKING_COLLECTOR_UID}
    #  consul:
    #    serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
    #     Consul cluster nodes, example: 10.0.0.1:8500,10.0.0.2:8500,10.0.0.3:8500
    #    hostPort: ${SW_CLUSTER_CONSUL_HOST_PORT:localhost:8500}
    core:
      default:
        # Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
        # Receiver: Receive agent data, Level 1 aggregate
        # Aggregator: Level 2 aggregate
        role: ${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
        restHost: ${SW_CORE_REST_HOST:0.0.0.0}
        restPort: ${SW_CORE_REST_PORT:12800}
        restContextPath: ${SW_CORE_REST_CONTEXT_PATH:/}
        gRPCHost: ${SW_CORE_GRPC_HOST:0.0.0.0}
        gRPCPort: ${SW_CORE_GRPC_PORT:11800}
        downsampling:
        - Hour
        - Day
        - Month
        # Set a timeout on metric data. After the timeout has expired, the metric data will automatically be deleted.
        recordDataTTL: ${SW_CORE_RECORD_DATA_TTL:90} # Unit is minute
        minuteMetricsDataTTL: ${SW_CORE_MINUTE_METRIC_DATA_TTL:90} # Unit is minute
        hourMetricsDataTTL: ${SW_CORE_HOUR_METRIC_DATA_TTL:36} # Unit is hour
        dayMetricsDataTTL: ${SW_CORE_DAY_METRIC_DATA_TTL:45} # Unit is day
        monthMetricsDataTTL: ${SW_CORE_MONTH_METRIC_DATA_TTL:18} # Unit is month
    storage:
      mysql:
    receiver-sharing-server:
      default:
    receiver-register:
      default:
    receiver-trace:
      default:
        bufferPath: ${SW_RECEIVER_BUFFER_PATH:../trace-buffer/}  # Path to trace buffer files, suggest to use absolute path
        bufferOffsetMaxFileSize: ${SW_RECEIVER_BUFFER_OFFSET_MAX_FILE_SIZE:100} # Unit is MB
        bufferDataMaxFileSize: ${SW_RECEIVER_BUFFER_DATA_MAX_FILE_SIZE:500} # Unit is MB
        bufferFileCleanWhenRestart: ${SW_RECEIVER_BUFFER_FILE_CLEAN_WHEN_RESTART:false}
        sampleRate: ${SW_TRACE_SAMPLE_RATE:10000} # The sample rate precision is 1/10000. 10000 means 100% sample in default.
        slowDBAccessThreshold: ${SW_SLOW_DB_THRESHOLD:default:200,mongodb:100} # The slow database access thresholds. Unit ms.
    receiver-jvm:
      default:
    receiver-clr:
      default:
    service-mesh:
      default:
        bufferPath: ${SW_SERVICE_MESH_BUFFER_PATH:../mesh-buffer/}  # Path to trace buffer files, suggest to use absolute path
        bufferOffsetMaxFileSize: ${SW_SERVICE_MESH_OFFSET_MAX_FILE_SIZE:100} # Unit is MB
        bufferDataMaxFileSize: ${SW_SERVICE_MESH_BUFFER_DATA_MAX_FILE_SIZE:500} # Unit is MB
        bufferFileCleanWhenRestart: ${SW_SERVICE_MESH_BUFFER_FILE_CLEAN_WHEN_RESTART:false}
    istio-telemetry:
      default:
    envoy-metric:
      default:
    #receiver_zipkin:
    #  default:
    #    host: ${SW_RECEIVER_ZIPKIN_HOST:0.0.0.0}
    #    port: ${SW_RECEIVER_ZIPKIN_PORT:9411}
    #    contextPath: ${SW_RECEIVER_ZIPKIN_CONTEXT_PATH:/}
    query:
      graphql:
        path: ${SW_QUERY_GRAPHQL_PATH:/graphql}
    alarm:
      default:
    telemetry:
      none:
  log4j2.xml: |-
    <Configuration status="INFO">
        <Appenders>
            <Console name="Console" target="SYSTEM_OUT">
                <PatternLayout charset="UTF-8" pattern="%d - %c -%-4r [%t] %-5p %x - %m%n"/>
            </Console>
        </Appenders>
        <Loggers>
            <logger name="org.eclipse.jetty" level="INFO"/>
            <logger name="org.apache.zookeeper" level="INFO"/>
            <logger name="org.elasticsearch.common.network.IfConfig" level="INFO"/>
            <logger name="io.grpc.netty" level="INFO"/>
            <logger name="org.apache.skywalking.oap.server.receiver.istio.telemetry" level="DEBUG"/>
            <Root level="INFO">
                <AppenderRef ref="Console"/>
            </Root>
        </Loggers>
    </Configuration>
  datasource-settings.properties: |-
        jdbcUrl: jdbc:mysql://172.16.77.154:33066/skywalking   
        dataSource.user: root
        dataSource.password: bnsbdl
        dataSource.cachePrepStmts: true
        dataSource.prepStmtCacheSize: 250
        dataSource.prepStmtCacheSqlLimit: 2048
        dataSource.useServerPrepStmts: true
        dataSource.useLocalSessionState: true
        dataSource.rewriteBatchedStatements: true
        dataSource.cacheResultSetMetadata: true
        dataSource.cacheServerConfiguration: true
        dataSource.elideSetAutoCommits: true
        dataSource.maintainTimeStats: false
  alarm-settings.yml: |-
    rules:
      service_resp_time_rule:
        indicator-name: service_resp_time
        threshold: 200
        op: ">"
        period: 1
        silence-period: 1
        count: 1
        message: Response time of service {name} is more than 200ms in last 1 minutes.
      webhooks:
  component-libraries.yml: |-
    Tomcat:
      id: 1
      languages: Java
    HttpClient:
      id: 2
      languages: Java,C#,Node.js
    Dubbo:
      id: 3
      languages: Java
    H2:
      id: 4
      languages: Java
    Mysql:
      id: 5
      languages: Java,C#,Node.js
    ORACLE:
      id: 6
      languages: Java
    Redis:
      id: 7
      languages: Java,C#,Node.js
    Motan:
      id: 8
      languages: Java
    MongoDB:
      id: 9
      languages: Java,C#,Node.js
    Resin:
      id: 10
      languages: Java
    Feign:
      id: 11
      languages: Java
    OKHttp:
      id: 12
      languages: Java
    SpringRestTemplate:
      id: 13
      languages: Java
    SpringMVC:
      id: 14
      languages: Java
    Struts2:
      id: 15
      languages: Java
    NutzMVC:
      id: 16
      languages: Java
    NutzHttp:
      id: 17
      languages: Java
    JettyClient:
      id: 18
      languages: Java
    JettyServer:
      id: 19
      languages: Java
    Memcached:
      id: 20
      languages: Java
    ShardingJDBC:
      id: 21
      languages: Java
    PostgreSQL:
      id: 22
      languages: Java,C#,Node.js
    GRPC:
      id: 23
      languages: Java
    ElasticJob:
      id: 24
      languages: Java
    RocketMQ:
      id: 25
      languages: Java
    httpasyncclient:
      id: 26
      languages: Java
    Kafka:
      id: 27
      languages: Java
    ServiceComb:
      id: 28
      languages: Java
    Hystrix:
      id: 29
      languages: Java
    Jedis:
      id: 30
      languages: Java
    SQLite:
      id: 31
      languages: Java,C#
    h2-jdbc-driver:
      id: 32
      languages: Java
    mysql-connector-java:
      id: 33
      languages: Java
    ojdbc:
      id: 34
      languages: Java
    Spymemcached:
      id: 35
      languages: Java
    Xmemcached:
      id: 36
      languages: Java
    postgresql-jdbc-driver:
      id: 37
      languages: Java
    rocketMQ-producer:
      id: 38
      languages: Java
    rocketMQ-consumer:
      id: 39
      languages: Java
    kafka-producer:
      id: 40
      languages: Java
    kafka-consumer:
      id: 41
      languages: Java
    mongodb-driver:
      id: 42
      languages: Java
    SOFARPC:
      id: 43
      languages: Java
    ActiveMQ:
      id: 44
      languages: Java
    activemq-producer:
      id: 45
      languages: Java
    activemq-consumer:
      id: 46
      languages: Java
    Elasticsearch:
      id: 47
      languages: Java
    transport-client:
      id: 48
      languages: Java
    http:
      id: 49
      languages: Java,C#,Node.js
    rpc:
      id: 50
      languages: Java,C#,Node.js
    RabbitMQ:
      id: 51
      languages: Java
    rabbitmq-producer:
      id: 52
      languages: Java
    rabbitmq-consumer:
      id: 53
      languages: Java
    Canal:
      id: 54
      languages: Java
    Gson:
      id: 55
      languages: Java
    Redisson:
      id: 56
      languages: Java
    AspNetCore:
      id: 3001
      languages: C#
    EntityFrameworkCore:
      id: 3002
      languages: C#
    SqlClient:
      id: 3003
      languages: C#
    CAP:
      id: 3004
      languages: C#
    StackExchange.Redis:
      id: 3005
      languages: C#
    SqlServer:
      id: 3006
      languages: C#
    Npgsql:
      id: 3007
      languages: C#
    MySqlConnector:
      id: 3008
      languages: C#
    EntityFrameworkCore.InMemory:
      id: 3009
      languages: C#
    EntityFrameworkCore.SqlServer:
      id: 3010
      languages: C#
    EntityFrameworkCore.Sqlite:
      id: 3011
      languages: C#
    Pomelo.EntityFrameworkCore.MySql:
      id: 3012
      languages: C#
    Npgsql.EntityFrameworkCore.PostgreSQL:
      id: 3013
      languages: C#
    InMemoryDatabase:
      id: 3014
      languages: C#
    AspNet:
      id: 3015
      languages: C#
    # NoeJS components
    # [4000, 5000) for Node.js agent
    HttpServer:
      id: 4001
      languages: Node.js
    express:
      id: 4002
      languages: Node.js
    Egg:
      id: 4003
      languages: Node.js
    Koa:
      id: 4004
      languages: Node.js
    # Component Server mapping defines the server display names of some components
    # e.g.
    # Jedis is a client library in Java for Redis server
    Component-Server-Mappings:
      mongodb-driver: MongoDB
      rocketMQ-producer: RocketMQ
      rocketMQ-consumer: RocketMQ
      kafka-producer: Kafka
      kafka-consumer: Kafka
      activemq-producer: ActiveMQ
      activemq-consumer: ActiveMQ
      rabbitmq-producer: RabbitMQ
      rabbitmq-consumer: RabbitMQ
      postgresql-jdbc-driver: PostgreSQL
      Xmemcached: Memcached
      Spymemcached: Memcached
      h2-jdbc-driver: H2
      mysql-connector-java: Mysql
      Jedis: Redis
      StackExchange.Redis: Redis
      Redisson: Redis
      SqlClient: SqlServer
      Npgsql: PostgreSQL
      MySqlConnector: Mysql
      EntityFrameworkCore.InMemory: InMemoryDatabase
      EntityFrameworkCore.SqlServer: SqlServer
      EntityFrameworkCore.Sqlite: SQLite
      Pomelo.EntityFrameworkCore.MySql: Mysql
      Npgsql.EntityFrameworkCore.PostgreSQL: PostgreSQL
      transport-client: Elasticsearch
