labkit

package module
v0.0.0-...-23fd86d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 0 Imported by: 0

README

LabKit 🧪 🔬 🥼 🥽 🦠 🧫 🧬 💉

LabKit is minimalist library to provide functionality for Go services at GitLab.


Packages

Correlation

import (
	"gitlab.com/gitlab-org/labkit/correlation"
)
Logging

import (
	logkit "gitlab.com/gitlab-org/labkit/log"
)
Masking

import (
	"gitlab.com/gitlab-org/labkit/mask"
)
Metrics

import (
	"gitlab.com/gitlab-org/labkit/metrics"
)
Monitoring

import (
	"gitlab.com/gitlab-org/labkit/monitoring"
)

Developing LabKit

Anyone can contribute!

Please be aware of the following however.

Public APIs in LabKit should be stable
  • LabKit is a library, not an application, and as such, we value compatibility highly.
  • Public APIs in LabKit should be backward compatible. This should be done by making APIs forward extensible.
    • Add methods, but do not add (non-optional) parameters to existing methods.
    • Use Functional Options where possible
APIs should be intuitive and friendly
  • APIs should have an intuitive interface.
  • Spend time ensuring thinking about what the best interface is.
  • Include excellent godocs, including package documentation in doc.go.
Dependency Management
  • Be extremely careful about the dependencies your packages include. Be prepared to justify any dependencies you bring into a package.
    • If not users will require a dependency, consider including it in a subpackage (eg gitlab.com/gitlab-org/labkit/correlation/grpc), especially if the dependency is large or has a deep dependency tree of it's own.
  • Be even more careful about the dependencies that you expose through the API of a package
  • Follow this rule: packages can depend on their parent packages, but not their siblings or children.
    • If required, declare common models in the root package
Architectural Philosophy

Taken from A Philosophy of Software Design, by John Ousterhout. This book is recommended reading.

  • Modules should be deep
  • Interfaces should be designed to make the most common usage as simple as possible
  • Separate general-purpose and special-purpose code
  • Design it twice
  • Comments should describe things that are not obvious from the code

Documentation

Overview

Package labkit is a minimalist library to provide functionality for Go services at GitLab.

Directories

Path Synopsis
Package correlation is the primary entrypoint into LabKit's correlation utilities.
Package correlation is the primary entrypoint into LabKit's correlation utilities.
raven
Package raven is allows correlation information to be added to raven requests.
Package raven is allows correlation information to be added to raven requests.
Package errortracking abstracts all error reporting features away from services like workhorse or pages
Package errortracking abstracts all error reporting features away from services like workhorse or pages
Package log provides sensible logging defaults for Labkit.
Package log provides sensible logging defaults for Labkit.
Package mask offers the functionality for non-reversible masking of sensitive data in the GitLab application.
Package mask offers the functionality for non-reversible masking of sensitive data in the GitLab application.
Package metrics is the primary entrypoint into LabKit's metrics utilities.
Package metrics is the primary entrypoint into LabKit's metrics utilities.
Package monitoring provides a monitoring endpoint and Continuous Profiling for Go service processes.
Package monitoring provides a monitoring endpoint and Continuous Profiling for Go service processes.
Package tracing is the primary entrypoint into LabKit's distributed tracing functionality.
Package tracing is the primary entrypoint into LabKit's distributed tracing functionality.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL