Grafana 프로비저닝

Grafana 프로비저닝 (Provision Grafana)

Grafana에는 구성 파일을 사용하는 능동적인 프로비저닝 시스템이 있어요. 데이터 소스와 대시보드를 파일로 정의해 버전 관리를 할 수 있으므로 GitOps를 더 자연스럽게 만들 수 있어요.

출처: 문서

본문

Grafana에는 구성 파일을 사용하는 능동적인 프로비저닝 시스템이 있어요. 데이터 소스와 대시보드를 버전 관리 가능한 파일로 정의할 수 있어 GitOps를 더 자연스럽게 만들어요.

Note

Infrastructure as code, Git Sync, 온프레미스 파일 프로비저닝 같은 고급 as-code 옵션은 Deploy, configure and provision Grafana with as-code workflows를 참고해요.

구성 파일 (Configuration file)

grafana.ini에서 구성할 수 있는 내용에 대한 자세한 내용은 Configuration을 참고해요.

구성 파일 위치 (Configuration file locations)

Grafana는 기본 구성을 <WORKING DIRECTORY>/conf/defaults.ini에서 읽어요.

Grafana는 커스텀 구성을 <WORKING DIRECTORY>/conf/custom.ini에서 읽어요. --config 옵션으로 커스텀 구성 경로를 오버라이드할 수 있어요.

Note

Deb 및 RPM 패키지는 구성 파일을 /etc/grafana/grafana.ini에 설치해요. Grafana init.d 스크립트는 --config 옵션을 그 경로로 설정해요.

환경 변수 사용 (Use environment variables)

모든 프로비저닝 구성에서 환경 변수 조회를 사용할 수 있어요. 환경 변수의 문법은 $ENV_VAR_NAME 또는 ${ENV_VAR_NAME}이에요.

다음이 적용돼요:

  • 환경 변수는 구성 값에만 사용하세요. 키나 구성 파일 구조의 더 큰 부분에는 사용하지 마세요.
  • 대시보드 프로비저닝 구성에는 환경 변수를 사용하되, 대시보드 정의 파일 자체에는 사용하지 마세요.

다음 예시는 환경 변수를 사용해 데이터 소스 URL 포트, 사용자, 비밀번호를 조회해요:

datasources:
  - name: Graphite
    url: http://localhost:$PORT
    user: $USER
    secureJsonData:
      password: $PASSWORD

특수 문자 $ 사용 (Use of the special character $)

Grafana의 프로비저닝 시스템은 $ 뒤의 모든 문자 집합을 변수 이름으로 간주해요.

대체 과정에서 Grafana는:

  1. ${ENV_VAR_NAME} 문법을 사용하는 변수를 먼저 대체해요.
  2. 그 다음 $ENV_VAR_NAME 문법을 사용하는 변수를 대체해요.

데이터에 $ 문자가 있고(예: Pa$sw0rd) 환경 변수를 사용한다면, 이중 확장을 피하기 위해 $ENV_VAR_NAME 문법을 사용해요. ${ENV_VAR_NAME} 문법을 사용하면 값이 먼저 Pa$sw0rd로 대체된 다음, $sw0rd가 또 다른 변수로 간주되어 다시 Pa로 대체돼요.

리터럴 값 Pa$sw0rd를 사용하려면 $ 문자를 이중 $$로 이스케이프해야 해요: Pa$$sw0rd.

다음 예시는 PASSWORD=Pa$sw0rd라고 가정할 때 변수가 어떻게 대체되는지 보여줘요:

datasources:
  - name: Graphite
    secureJsonData:
      password1: $PASSWORD # Resolved as Pa$sw0rd
      password2: ${PASSWORD} # Resolved as Pa
      password3: 'Pa$$sw0rd' # Resolved as Pa$sw0rd
      password4: 'Pa$sw0rd' # Resolved as Pa

데이터 소스 (Data sources)

provisioning/datasources 디렉터리에 YAML 구성 파일을 추가하면 Grafana의 데이터 소스를 관리할 수 있어요. 각 구성 파일은 시작 시 추가하거나 업데이트할 datasources 키 아래의 데이터 소스 목록을 포함해요. 데이터 소스가 이미 존재하면 Grafana는 프로비저닝된 구성 파일과 일치하도록 재구성해요.

deleteDatasources 키를 사용해 자동으로 삭제할 데이터 소스를 나열할 수도 있어요. Grafana는 datasources 목록의 데이터 소스를 추가·업데이트하기 전에 deleteDatasources에 나열된 데이터 소스를 삭제해요.

데이터 소스가 프로비저닝 파일에서 제거될 때 프로비저닝된 데이터 소스를 자동으로 삭제하도록 Grafana를 구성할 수 있어요. 이렇게 하려면 데이터 소스 프로비저닝 파일의 루트에 prune: true를 추가해요. 이 구성으로 프로비저닝 파일을 완전히 제거해도 Grafana는 프로비저닝된 데이터 소스를 함께 제거해요.

여러 Grafana 인스턴스 실행 (Run multiple Grafana instances)

여러 Grafana 인스턴스를 실행한다면 각 데이터 소스에 버전 번호를 추가하고, 구성을 업데이트할 때 그 값을 증가시켜요. Grafana는 구성 파일에 설정된 버전 번호와 같거나 낮은 버전의 데이터 소스만 업데이트해요. 이렇게 하면 버전 번호를 정의하지 않은 다른 버전의 datasource.yaml 파일이 있고 동시에 인스턴스를 재시작해도, 오래된 구성이 최신 구성을 덮어쓰는 것을 방지해요.

데이터 소스 구성 파일 예시 (Example data source configuration file)

이 예시는 Graphite 데이터 소스를 프로비저닝해요:

# Configuration file version
apiVersion: 1

# List of data sources to delete from the database.
deleteDatasources:
  - name: Graphite
    orgId: 1

# Mark provisioned data sources for deletion if they are no longer in a provisioning file.
# It takes no effect if data sources are already listed in the deleteDatasources section.
prune: true

# List of data sources to insert/update depending on what's
# available in the database.
datasources:
  # <string, required> Sets the name you use to refer to
  # the data source in panels and queries.
  - name: Graphite
    # <string, required> Sets the data source type.
    type: graphite
    # <string, required> Sets the access mode, either
    # proxy or direct (Server or Browser in the UI).
    # Some data sources are incompatible with any setting
    # but proxy (Server).
    access: proxy
    # <int> Sets the organization id. Defaults to orgId 1.
    orgId: 1
    # <string> Sets a custom UID to reference this
    # data source in other parts of the configuration.
    # If not specified, Grafana generates one.
    uid: my_unique_uid
    # <string> Sets the data source's URL, including the
    # port.
    url: http://localhost:8080
    # <string> Sets the database user, if necessary.
    user:
    # <string> Sets the database name, if necessary.
    database:
    # <bool> Enables basic authorization.
    basicAuth:
    # <string> Sets the basic authorization username.
    basicAuthUser:
    # <bool> Enables credential headers.
    withCredentials:
    # <bool> Toggles whether the data source is pre-selected
    # for new panels. You can set only one default
    # data source per organization.
    isDefault:
    # <map> Fields to convert to JSON and store in jsonData.
    jsonData:
      # <string> Defines the Graphite service's version.
      graphiteVersion: '1.1'
      # <bool> Enables TLS authentication using a client
      # certificate configured in secureJsonData.
      tlsAuth: true
      # <bool> Enables TLS authentication using a CA
      # certificate.
      tlsAuthWithCACert: true
    # <map> Fields to encrypt before storing in jsonData.
    secureJsonData:
      # <string> Defines the CA cert, client cert, and
      # client key for encrypted authentication.
      tlsCACert: '...'
      tlsClientCert: '...'
      tlsClientKey: '...'
      # <string> Sets the database password, if necessary.
      password:
      # <string> Sets the basic authorization password.
      basicAuthPassword:
    # <int> Sets the version. Used to compare versions when
    # updating. Ignored when creating a new data source.
    version: 1
    # <bool> Allows users to edit data sources from the
    # Grafana UI.
    editable: false

특정 데이터 소스의 프로비저닝 예시는 해당 데이터 소스 설명서를 참고해요.

JSON 데이터 (JSON data)

모든 데이터 소스가 동일한 구성 설정을 갖는 것은 아니며, 데이터 소스 프로비저닝 파일의 필드는 가장 일반적인 것들뿐이에요. 데이터 소스의 나머지 설정을 프로비저닝하려면 그것들을 jsonData 필드에 JSON으로 포함해요.

내장 코어 데이터 소스의 일반적인 설정:

이름 타입 데이터 소스 설명
tlsAuth boolean HTTP*, MySQL secure JSON data에 구성된 클라이언트 인증서를 사용한 TLS 인증 활성화
tlsAuthWithCACert boolean HTTP*, MySQL, PostgreSQL CA 인증서를 사용한 TLS 인증 활성화
tlsSkipVerify boolean HTTP*, MySQL, PostgreSQL, MSSQL 클라이언트가 서버 인증서 체인과 호스트 이름을 검증할지 제어
serverName string HTTP*, MSSQL Optional. 인증서 CN/SAN 검증에 사용되는 서버 이름 제어. 기본값은 데이터 소스 URL 사용
timeout string HTTP* 요청 타임아웃(초). dataproxy.timeout 옵션 오버라이드
graphiteVersion string Graphite Graphite 버전
timeInterval string Prometheus, Elasticsearch, InfluxDB, MySQL, PostgreSQL, MSSQL 이 데이터 소스에 사용해야 하는 최저 interval/step 값
httpMode string InfluxDB HTTP 메서드. 'GET', 'POST', 기본값 GET
maxSeries number InfluxDB Grafana가 처리하는 최대 시리즈/테이블 수
httpMethod string Prometheus HTTP 메서드. 'GET', 'POST', 기본값 POST
customQueryParameters string Prometheus URL 인코딩된 문자열로 추가할 쿼리 파라미터
manageAlerts boolean Prometheus, Loki Alerting UI로 알림 관리
alertmanagerUid string Prometheus, Loki 이 데이터 소스의 알림을 관리하는 Alertmanager의 UID
timeField string Elasticsearch 타임스탬프로 사용할 필드
interval string Elasticsearch 인덱스 날짜 시간 형식. nil(No Pattern), 'Hourly', 'Daily', 'Weekly', 'Monthly' 또는 'Yearly'
logMessageField string Elasticsearch 로그 메시지로 사용할 필드
logLevelField string Elasticsearch 로그 메시지의 우선순위를 나타내는 필드
maxConcurrentShardRequests number Elasticsearch 각 하위 검색 요청이 노드당 실행하는 최대 동시 샤드 요청 수
sigV4Auth boolean Elasticsearch, Prometheus SigV4 사용 활성화
sigV4AuthType string Elasticsearch, Prometheus SigV4 인증 공급자. default/credentials/keys
sigV4ExternalId string Elasticsearch, Prometheus Optional SigV4 외부 ID
sigV4AssumeRoleArn string Elasticsearch, Prometheus Optional 가정할 SigV4 ARN 역할
sigV4Region string Elasticsearch, Prometheus SigV4 AWS 리전
sigV4Profile string Elasticsearch, Prometheus Optional SigV4 자격 증명 프로필
authType string Amazon CloudWatch 인증 공급자. default/credentials/keys
externalId string Amazon CloudWatch Optional 외부 ID
assumeRoleArn string Amazon CloudWatch Optional 가정할 ARN 역할
defaultRegion string Amazon CloudWatch Optional 기본 AWS 리전
customMetricsNamespaces string Amazon CloudWatch 커스텀 메트릭의 네임스페이스
profile string Amazon CloudWatch Optional 자격 증명 프로필
tsdbVersion string OpenTSDB 버전
tsdbResolution string OpenTSDB 해상도
sslmode string PostgreSQL SSL 모드. 'disable', 'require', 'verify-ca' 또는 'verify-full'
tlsConfigurationMethod string PostgreSQL SSL 인증서 구성. 'file-path' 또는 'file-content'
sslRootCertFile string PostgreSQL, MSSQL SSL 서버 루트 인증서 파일. Grafana 사용자가 읽을 수 있어야 함
sslCertFile string PostgreSQL SSL 클라이언트 인증서 파일. Grafana 사용자가 읽을 수 있어야 함
sslKeyFile string PostgreSQL SSL 클라이언트 키 파일. 오직 Grafana 사용자만 읽을 수 있어야 함
encrypt string MSSQL SSL 암호화 처리를 결정. 옵션: disable - 클라이언트-서버 간 전송 데이터를 암호화하지 않음; false - 로그인 패킷 외에는 암호화하지 않음; true - 전송 데이터를 암호화함. 기본값 false
postgresVersion number PostgreSQL Postgres 버전을 숫자로 표기 (903/904/905/906/1000 = v9.3, v9.4, …, v10)
timescaledb boolean PostgreSQL TimescaleDB 확장 사용 활성화
maxOpenConns number MySQL, PostgreSQL, MSSQL 데이터베이스에 대한 최대 열린 연결 수 (Grafana v5.4+)
maxIdleConns number MySQL, PostgreSQL, MSSQL 유휴 연결 풀의 최대 연결 수 (Grafana v5.4+)
connMaxLifetime number MySQL, PostgreSQL, MSSQL 연결을 재사용할 수 있는 최대 시간(초) (Grafana v5.4+)
keepCookies array HTTP* 데이터 소스와 통신할 때 전달해야 하는 쿠키
prometheusVersion string Prometheus Prometheus 데이터 소스 버전 (예: 2.37.0, 2.24.0)
prometheusType string Prometheus Prometheus 데이터베이스 유형. 옵션: Prometheus, Cortex, Mimir, Thanos
cacheLevel string Prometheus 브라우저 캐시 기간을 결정. 유효 값: Low, Medium, High, None
incrementalQuerying string Prometheus Experimental: 느린 데이터 소스에서 대시보드 새로고침 성능을 높이기 위한 증분 쿼리 활성화
incrementalQueryOverlapWindow string Prometheus Experimental: 증분 쿼리 오버랩 윈도우 구성. 예: 180s 또는 15m 같은 유효한 기간 문자열 필요. 기본값 10m (10분)
disableRecordingRules boolean Prometheus Experimental: Prometheus recording rules 끄기
seriesEndpoint boolean Prometheus Prometheus /api/v1/series 엔드포인트 사용
implementation string Alertmanager Alertmanager 데이터 소스 구현 (예: prometheus, cortex, mimir)
handleGrafanaManagedAlerts boolean Alertmanager 활성화되면 Grafana-managed 알림이 이 Alertmanager로 전송됨

Note

*HTTP**로 표시된 데이터 소스는 HTTP 프로토콜로 통신해요. 여기에는 MySQL, PostgreSQL, MSSQL을 제외한 모든 코어 데이터 소스 플러그인이 포함돼요.

특정 데이터 소스의 JSON 데이터 예시는 해당 데이터 소스 설명서를 참고해요.

Secure JSON 데이터 (Secure JSON data)

Secure JSON data는 secret key로 암호화된 설정의 맵이에요. 이 암호화는 Grafana 사용자로부터 JSON 데이터를 숨겨요. TLS 인증서와 데이터 소스 HTTP 요청의 비밀번호를 저장하려면 secure JSON data를 사용해야 해요. 이 모든 설정은 선택 사항이에요.

이름 타입 데이터 소스 설명
tlsCACert string HTTP*, MySQL, PostgreSQL 나가는 요청용 CA 인증서
tlsClientCert string HTTP*, MySQL, PostgreSQL 나가는 요청용 TLS 클라이언트 인증서
tlsClientKey string HTTP*, MySQL, PostgreSQL 나가는 요청용 TLS 클라이언트 키
password string HTTP*, MySQL, PostgreSQL, MSSQL 비밀번호
basicAuthPassword string HTTP* 기본 인증용 비밀번호
accessKey string Amazon CloudWatch Amazon CloudWatch 연결용 액세스 키
secretKey string Amazon CloudWatch Amazon CloudWatch 연결용 시크릿 키
sigV4AccessKey string Elasticsearch, Prometheus SigV4 액세스 키. keys 인증 공급자 사용 시 필요
sigV4SecretKey string Elasticsearch, Prometheus SigV4 시크릿 키. keys 인증 공급자 사용 시 필요

Note

HTTP* 태그는 HTTP 프로토콜로 통신하는 데이터 소스를 나타내며, MySQL, PostgreSQL, MSSQL을 제외한 모든 코어 데이터 소스 플러그인을 포함해요.

데이터 소스용 커스텀 HTTP 헤더 (Custom HTTP headers for data sources)

Grafana 프로비저닝이 관리하는 데이터 소스로 보내는 모든 요청에 HTTP 헤더를 추가할 수 있어요.

헤더 이름은 jsonData 필드에, 헤더 값은 secureJsonData에 구성해요. 다음 예시는 HeaderName 헤더를 HeaderValue로, Authorization 헤더를 Bearer XXXXXXXXX로 설정해요:

apiVersion: 1

datasources:
  - name: Graphite
    jsonData:
      httpHeaderName1: 'HeaderName'
      httpHeaderName2: 'Authorization'
    secureJsonData:
      httpHeaderValue1: 'HeaderValue'
      httpHeaderValue2: 'Bearer XXXXXXXXX'

플러그인 (Plugins)

provisioning/plugins 디렉터리에 하나 이상의 YAML 구성 파일을 추가하면 Grafana의 플러그인 애플리케이션을 관리할 수 있어요. 각 구성 파일은 시작 시 Grafana가 구성하는 apps 목록을 포함해요. Grafana는 각 앱이 파일의 구성을 사용하도록 설정해요.

Note

이 기능은 플러그인 구성(plugin configurations)을 프로비저닝할 수 있게 하지, 플러그인 자체를 프로비저닝하지는 않아요. 플러그인 구성 프로비저닝을 사용하려면 플러그인을 이미 설치했어야 해요.

플러그인 구성 파일 예시 (Example plugin configuration file)

apiVersion: 1

apps:
  # <string> the type of app, plugin identifier. Required
  - type: raintank-worldping-app
    # <int> Org ID. Default to 1, unless org_name is specified
    org_id: 1
    # <string> Org name. Overrides org_id unless org_id not specified
    org_name: Main Org.
    # <bool> disable the app. Default to false.
    disabled: false
    # <map> fields that will be converted to json and stored in jsonData. Custom per app.
    jsonData:
      # key/value pairs of string to object
      key: value
    # <map> fields that will be converted to json, encrypted and stored in secureJsonData. Custom per app.
    secureJsonData:
      # key/value pairs of string to string
      key: value

대시보드 (Dashboards)

provisioning/dashboards 디렉터리에 하나 이상의 YAML 구성 파일을 추가하면 Grafana의 대시보드를 관리할 수 있어요. 각 구성 파일은 Grafana가 로컬 파일시스템에서 대시보드를 로드하는 데 사용하는 providers 목록을 포함해요.

대시보드 구성 파일 예시 (Example dashboard configuration file)

apiVersion: 1

providers:
  # <string> an unique provider name. Required
  - name: 'a unique provider name'
    # <int> Org id. Default to 1
    orgId: 1
    # <string> name of the dashboard folder.
    folder: ''
    # <string> folder UID. will be automatically generated if not specified
    folderUid: ''
    # <string> provider type. Default to 'file'
    type: file
    # <bool> disable dashboard deletion
    disableDeletion: false
    # <int> how often Grafana will scan for changed dashboards
    updateIntervalSeconds: 10
    # <bool> allow updating provisioned dashboards from the UI
    allowUiUpdates: false
    options:
      # <string, required> path to dashboard files on disk. Required when using the 'file' type
      path: /var/lib/grafana/dashboards
      # <bool> use folder names from filesystem to create folders in Grafana
      foldersFromFilesStructure: true

Grafana가 시작되면 구성된 경로에서 찾은 모든 대시보드를 업데이트하거나 생성해요. 이 파일들은 대시보드 JSON으로 대시보드를 정의할 수 있어요:

{
  "dashboard": {
    "id": null,
    "uid": "example-dashboard",
    "title": "Production Overview",
    "tags": ["production", "monitoring"],
    "timezone": "browser",
    "schemaVersion": 16,
    "version": 0,
    "refresh": "30s"
  },
  "folderUid": "monitoring-folder",
  "overwrite": true
}

또는 Kubernetes 형식으로, 예를 들어 kubernetes-dashboard.json:

{
  "kind": "Dashboard",
  "apiVersion": "dashboard.grafana.app/v1",
  "metadata": {
    "name": "dashboard-uid"
  },
  "spec": {
    "title": "Dashboard title",
    "panels": [
      {
        "gridPos": {
          "h": 13,
          "w": 24,
          "x": 0,
          "y": 0
        },
        "options": {
          "content": "<div><h1>Example panel</h1></div>",
          "mode": "html"
        },
        "transparent": true,
        "type": "text"
      }
    ]
  }
}

대시보드 v2 / 동적 대시보드를 프로비저닝하려면 반드시 Kubernetes 리소스 형식을 사용해야 해요.

Note

folder 필드를 설정하지 않으면 Grafana는 대시보드를 루트 수준에 설치해요.

프로비저닝된 대시보드 파일의 업데이트 감지 (Detect updates to provisioned dashboards files)

Grafana가 대시보드를 프로비저닝한 후 파일시스템의 변경 사항을 확인하고 필요에 따라 대시보드를 업데이트해요.

Grafana가 이를 수행하는 메커니즘은 updateIntervalSeconds 값에 따라 달라져요:

  • 10초 초과: Grafana가 해당 간격으로 경로를 폴링해요.
  • 10초 이하: Grafana가 파일시스템을 감시해 변경을 감지하면 대시보드를 업데이트해요.

Note

updateIntervalSeconds가 10 이하일 때 Grafana는 파일시스템 감시(watch) 이벤트에 의존해 변경을 감지해요. 파일시스템과 대시보드 파일을 마운트·동기화하는 방식(Docker 바인드 마운트나 일부 네트워크 파일시스템 등)에 따라 그 이벤트가 Grafana에 도달하지 않을 수 있어요. 이를 해결하려면 updateIntervalSeconds를 10 초과로 설정해 폴링을 강제하거나, 파일시스템 감시 이벤트가 전파되도록 설정을 업데이트해요.

프로비저닝된 대시보드 변경 (Make changes to a provisioned dashboard)

Grafana UI에서 프로비저닝된 대시보드를 변경할 수 있지만, 변경 사항을 프로비저닝 소스에 자동으로 저장하는 것은 불가능해요. allowUiUpdatestrue로 설정되어 있고 프로비저닝된 대시보드를 변경하면, 대시보드를 저장할 때 Grafana는 변경사항을 데이터베이스에 유지해요.

Caution

UI에서 프로비저닝된 대시보드를 저장한 후 나중에 프로비저닝 소스를 업데이트하면, Grafana는 항상 데이터베이스의 대시보드를 프로비저닝 파일의 것으로 덮어써요. Grafana는 JSON 파일의 version 속성이 데이터베이스의 대시보드보다 낮더라도 이를 무시해요.

Caution

UI에서 프로비저닝된 대시보드를 저장하고 프로비저닝 소스를 제거하면, disableDeletion 옵션을 true로 설정하지 않는 한 Grafana는 데이터베이스의 대시보드를 삭제해요.

allowUiUpdatesfalse로 설정하면 프로비저닝된 대시보드에 변경 사항을 저장할 수 없어요. 프로비저닝된 대시보드에 변경을 저장하려 하면 Grafana가 Cannot save provisioned dashboard 대화 상자를 표시해요.

Grafana는 대시보드의 JSON 정의를 내보낼 수 있는 옵션을 제공해요. 대시보드 JSON 정의를 내보내려면:

  1. 저장 시 Advanced options를 클릭해 섹션을 펼친 후 다음을 선택해요: Model: Classic 또는 V2 Resource 중 선택. Grafana v12.4 이하에서 대시보드를 사용할 계획이면 Classic을 선택해요. Format: V2 Resource에서만, JSON 또는 YAML 중 선택
  2. Copy JSON to Clipboard 또는 Save JSON to file을 클릭해요.

Grafana는 프로비저닝 워크플로를 돕기 위해 대시보드 JSON에서 id 필드를 제거해요. 이제 대시보드 변경 사항을 프로비저닝 소스에 다시 동기화할 수 있어요.

재사용 가능한 대시보드 URL (Reusable dashboard URLs)

JSON 파일의 대시보드가 UID를 포함한다면, Grafana는 해당 UID로 데이터베이스의 대시보드를 업데이트해요. 이를 통해 Grafana 인스턴스 간에 대시보드를 마이그레이션하고 일관된 대시보드 URL을 유지할 수 있어요. Grafana가 시작되면 구성된 폴더에서 사용 가능한 모든 대시보드를 생성하거나 업데이트해요.

Caution

프로비저닝으로 기존 대시보드를 덮어쓸 수 있어요. 폴더 내에서 같은 title을 재사용하거나 같은 Grafana 인스턴스 내에서 같은 uid를 재사용해 일관성 없는 동작을 피하도록 주의하세요.

파일시스템의 폴더 구조를 Grafana에 프로비저닝 (Provision folders structure from filesystem to Grafana)

Git 저장소나 파일시스템에서 폴더를 사용해 대시보드를 이미 저장하고 있고, Grafana 메뉴에서 같은 폴더 이름을 갖고 싶다면 foldersFromFilesStructure 옵션을 사용해요.

예를 들어 다음 대시보드 구조를 파일시스템에서 Grafana로 복제하려면:

/etc/dashboards
├── /server
│   ├── /common_dashboard.json
│   └── /network_dashboard.json
└── /application
    ├── /requests_dashboard.json
    └── /resources_dashboard.json

다음 프로비저닝 구성 파일을 사용해요:

apiVersion: 1

providers:
  - name: dashboards
    type: file
    updateIntervalSeconds: 30
    options:
      path: /etc/dashboards
      foldersFromFilesStructure: true

Grafana는 UI에 serverapplication 폴더를 생성해요.

foldersFromFilesStructure를 사용하려면 folderfolderUid 옵션을 설정하지 않아야 해요.

대시보드를 루트 수준으로 프로비저닝하려면 path의 루트에 저장해요.

Note

중첩 폴더 구조가 지원돼요: 디스크의 폴더 계층이 Grafana에 재생성돼요. 예를 들어 folderTwo/folderThree/dashboard3.jsonfolderThree를 포함하는 folderTwo 폴더를 만들고 그 안에 대시보드가 들어가요. 폴더 깊이는 4 수준으로 제한돼요.

알림 (Alerting)

Grafana Alerting 프로비저닝에 대한 정보는 Provision Grafana Alerting resources를 참고해요.

지원되는 설정 (Supported settings)

다음 섹션은 각 알림 알림 유형에 대해 지원되는 설정과 보안 설정을 상세히 설명해요. 프로비저닝 YAML에서 설정은 settings를, 보안 설정은 secure_settings를 사용해요. Grafana는 보안 설정을 데이터베이스에 암호화해 저장해요.

알림 알림 pushover

이름 보안 설정
apiToken yes
userKey yes
device
priority
okPriority
retry
expire
sound
okSound

알림 알림 discord

이름 보안 설정
url yes
avatar_url
content
use_discord_username

알림 알림 slack

이름 보안 설정
url yes
recipient
username
icon_emoji
icon_url
uploadImage
mentionUsers
mentionGroups
mentionChannel
token yes
color

알림 알림 victorops

이름
url
autoResolve

알림 알림 kafka

이름
kafkaRestProxy
kafkaTopic

알림 알림 LINE

이름 보안 설정
token yes

알림 알림 MQTT

이름 보안 설정
brokerUrl
clientId
topic
messageFormat
username
password yes
retain
qos
tlsConfig
TLS 구성
이름 보안 설정
insecureSkipVerify
clientCertificate yes
clientKey yes
caCertificate yes

알림 알림 pagerduty

이름 보안 설정
integrationKey yes
autoResolve

알림 알림 sensu

이름 보안 설정
url
source
handler
username
password yes

알림 알림 sensugo

이름 보안 설정
url
apikey yes
entity
check
handler
namespace

알림 알림 prometheus-alertmanager

이름 보안 설정
url
basicAuthUser
basicAuthPassword yes

알림 알림 teams

이름 보안 설정
url

알림 알림 dingding

이름 보안 설정
url

알림 알림 email

이름 보안 설정
singleEmail
addresses

알림 알림 opsgenie

이름 보안 설정
apiKey yes
apiUrl
autoClose
overridePriority
sendTagsAs

알림 알림 telegram

이름 보안 설정
bottoken yes
chatid
uploadImage

알림 알림 threema

이름 보안 설정
gateway_id
recipient_id
api_secret yes

알림 알림 webhook

이름 보안 설정
url
http_method
username
password yes
tls_config
hmac_config
TLS 구성
이름 보안 설정
insecureSkipVerify
clientCertificate yes
clientKey yes
caCertificate yes
HMAC 서명 구성
이름 보안 설정
secret yes
header
timestampHeader

알림 알림 googlechat

이름 보안 설정
url

알림 알림 Cisco Webex Teams

이름 보안 설정
message
room_id
api_url
bot_token yes

Grafana Enterprise

Grafana Enterprise는 다음을 지원해요:

구성 관리 도구 (Configuration management tools)

Grafana 커뮤니티는 많은 인기 구성 관리 도구용 라이브러리를 유지 관리해요.

도구 프로젝트
Puppet https://forge.puppet.com/puppet/grafana
Ansible https://github.com/grafana/grafana-ansible-collection
Chef https://github.com/sous-chefs/chef-grafana
NixOS services.grafana.provisionmodule

더 알아보기 (Learn more)