Namespaces

M3DB uses the concept of namespaces to determine how metrics are stored and retained. The M3DB operator allows a user to define their own namespaces, or to use a set of presets we consider to be suitable for production use cases.

Namespaces are configured as part of an m3dbcluster spec.

Presets

10s:2d

This preset will store metrics at 10 second resolution for 2 days. For example, in your cluster spec:

  1. spec:
  2. ...
  3. namespaces:
  4. - name: metrics-short-term
  5. preset: 10s:2d

1m:40d

This preset will store metrics at 1 minute resolution for 40 days.

  1. spec:
  2. ...
  3. namespaces:
  4. - name: metrics-long-term
  5. preset: 1m:40d

Custom Namespaces

You can also define your own custom namespaces by setting the NamespaceOptions within a cluster spec. The API lists all available fields. As an example, a namespace to store 7 days of data may look like:

  1. ...
  2. spec:
  3. ...
  4. namespaces:
  5. - name: custom-7d
  6. options:
  7. bootstrapEnabled: true
  8. flushEnabled: true
  9. writesToCommitLog: true
  10. cleanupEnabled: true
  11. snapshotEnabled: true
  12. repairEnabled: false
  13. retentionOptions:
  14. retentionPeriod: 168h
  15. blockSize: 12h
  16. bufferFuture: 20m
  17. bufferPast: 20m
  18. blockDataExpiry: true
  19. blockDataExpiryAfterNotAccessPeriod: 5m
  20. indexOptions:
  21. enabled: true
  22. blockSize: 12h