Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
docs: added features to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
shanduur committed Aug 2, 2023
1 parent e442550 commit 557adf8
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,16 @@ A Container Object Storage Interface (COSI) library and other helpful utilities
- [gocosi](#gocosi)
- [Table of contents](#table-of-contents)
- [Quick Start](#quick-start)
- [Features](#features)
- [Automatic Starting of Traces](#automatic-starting-of-traces)
- [Automatic Panic Recovery](#automatic-panic-recovery)
- [Control Over Permissions by Default](#control-over-permissions-by-default)
- [Configuration via Environment](#configuration-via-environment)
- [Supports Any Logger Through logr](#supports-any-logger-through-logr)
- [Configuration](#configuration)
- [Environment variables](#environment-variables)
- [Contributing](#contributing)
- [Similar projects](#similar-projects)

## Quick Start

Expand Down Expand Up @@ -44,6 +52,28 @@ cosi-osp
4 directories, 5 files
```

## Features

### Automatic Starting of Traces

The gocosi package includes an automatic trace initialization feature using the `otelgrpc.UnaryServerInterceptor()` function. This functionality enables the automatic creation of traces for each incoming request. Alongside the tracing capability, this interceptor adds detailed events to the traces, enhancing the visibility into the request lifecycle.

### Automatic Panic Recovery

In the event of a panic occurring during the execution of your COSI driver, the package offers seamless recovery through the use of `recovery.UnaryServerInterceptor`. This interceptor employs a custom panic handler that captures the panic message and the associated debug stack trace. Every panic is logged for thorough error analysis. Additionally, the package provides a default OpenTelemetry (OTEL) Counter metric that tracks the occurrence of panics, aiding in monitoring and troubleshooting.

### Control Over Permissions by Default

The gocosi package introduces a built-in mechanism designed to grant users control over the permissions and access rights associated with the UNIX socket. This inherent feature empowers you to define specific user and group ownership for the socket, along with customizable permission settings. This level of control ensures that the socket's security and accessibility align with your application's requirements.

### Configuration via Environment

Streamlining the configuration process, the gocosi package exclusively employs environment variables for end-user configuration. This design choice simplifies setup and customization, as users can conveniently adjust various aspects of the COSI driver's behavior by modifying environment variables.

### Supports Any Logger Through logr

To cater to diverse logging preferences, the gocosi package seamlessly integrates with a wide range of loggers by leveraging the versatile [logr](github.com/go-logr/logr) library. This compatibility enables you to use your preferred logger implementation, ensuring consistency with your existing logging practices and enhancing your debugging and monitoring capabilities.

## Configuration

### Environment variables
Expand All @@ -54,3 +84,11 @@ cosi-osp
- `X_COSI_ENDPOINT_PERMS` (default: `0755`) - it should be set when the COSI endpoint is a UNIX socket file. It determines the file permissions (in octal notation) of the UNIX socket file. If the COSI endpoint is a TCP socket, this setting has no effect.
- `X_COSI_ENDPOINT_USER` (default: *The user that starts the process*) - it should be set when the COSI endpoint is a UNIX socket file. It determines the owner (user) of the UNIX socket file. If the COSI endpoint is a TCP socket, this setting has no effect.
- `X_COSI_ENDPOINT_GROUP` (default: *The group that starts the process*) - it should be set when the COSI endpoint is a UNIX socket file. It determines the group ownership of the UNIX socket file. If the COSI endpoint is a TCP socket, this setting has no effect.

## Contributing

You want to contibute? Hop into the [CONTRIBUTING.md](CONTRIBUTING.md) and find how you can help the project!

## Similar projects

This project was inspired by [dell/gocsi](github.com/dell/gocsi).

0 comments on commit 557adf8

Please sign in to comment.