# docker-compose.yml
version: "3.9"
services:
onedrive_exporter:
image: ghcr.io/andrzejressel/onedrive-exporter:VERSION
environment:
- ONEDRIVE_CLIENT_ID=CLIENT_ID
- ONEDRIVE_REDIRECT=http://localhost:8080/
- ONEDRIVE_CLIENT_SECRET=CLIENT_SECRET
volumes:
- onedrivedata:/data
ports:
- "8080:8080"# prometheus.yaml
- job_name: 'onedrive'
metrics_path: /q/metrics
static_configs:
- targets: ['localhost:8080']- Open https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade and then click
New registration. - Enter a name for your app, choose account type
Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox), selectWebinRedirect URI, then type (be careful when copying and pasting)http://localhost:8080/onedrive(or your custom url where collector will be available +/onedrivesuffix) and click Register. Copy and keep theApplication (client) ID- this is yourCLIENT_ID. - Under
manageselectCertificates & secrets, clickNew client secret. Enter a description (can be anything) and setExpiresto 24 months. Copy and keep that secret Value - this is yourCLIENT_SECRET. - Under
manageselectAPI permissions, clickAdd a permissionand selectMicrosoft Graphthen selectdelegated permissions. - Search and select the following permissions:
Files.Read,offline_accessandUser.Read. Once selected clickAdd permissionsat the bottom.
- It does not work with GraalVM. It may in the future - Azure/azure-sdk-for-java#21735