Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oracle/oci-grafana-logs

Grafana datasource plugin for OCI logs
https://github.com/oracle/oci-grafana-logs

grafana logs oci oracle

Last synced: about 2 months ago
JSON representation

Grafana datasource plugin for OCI logs

Awesome Lists containing this project

README

        

# Oracle Cloud Infrastructure Logging Data Source

## Introduction

Grafana is a popular technology that makes it easy to visualize logs and metrics.
The OCI Logging Grafana Plugin can be used to extend Grafana by adding
[Oracle Cloud Infrastructure Logging][1] as a data source in Grafana.

The plugin allows you to retrieve logs related to a number of resources on
Oracle Cloud: Compute, Networking, Storage, custom logs from your application,
and audit logs generated by Oracle Cloud services. Once these logs are in Grafana,
they can be analyzed along with metrics, giving you a single pane of glass for your
application monitoring needs.

Latest plugin version 4.X.X (available on [Grafana Marketplace](https://grafana.com/grafana/plugins/oci-logs-datasource/)) is compatible with **Grafana 10**.

Breaking change!
In case you are migrating from a previous version (2.x.x or below) of the OCI Logging Grafana Plugin and are not using Instance Principals (**Authentication Provider** not set as **OCI instance**), please refer to the [**Migration Instructions for Grafana OCI Logging Data Source Settings (User Principals and Single Tenancy mode only)**](https://github.com/oracle/oci-grafana-logs/blob/main/docs/migration.md) because you will have to reconfigure the plugin setup.

For custom logs from your application, see [Custom Logging on OCI][2].
## Prerequisites

We will discuss two different Grafana IAM configurations that need to be in
place, for Grafana to fetch the logs from Oracle Cloud Logging Service.

### For local/dev box environment and Grafana Cloud

#### Installation

Please refers to the following **compatibility matrix** to choose plugin version accordingly to your Grafana installation: [Compatibility Matrix](https://github.com/oracle/oci-grafana-logs/blob/Grafana10-support-test/docs/compatmatrix.md)

In order to simplify the installation process, we created detailed guides for you to follow.

Depending on your installation scenario you can use the following guides:

* Install Grafana and the OCI Logs plugin on a Linux host using [this document](https://github.com/oracle/oci-grafana-logs/blob/main/docs/linux.md).

* Install Grafana and the OCI Logs plugin on Grafana Cloud using [this document](https://github.com/oracle/oci-grafana-logs/blob/main/docs/grafanacloud.md).

* Install Grafana and the OCI Logs plugin on a MacOS host using [this document](https://github.com/oracle/oci-grafana-logs/blob/main/docs/macos.md).

#### Configure OCI Identity Policies

In the OCI console under **Identity > Groups** click **Create Group** and create
a new group called **GrafanaLoggingUserGroup**. Add the user configured in the
OCI CLI to the newly-created group.

![alt text](https://github.com/oracle/oci-grafana-logs/blob/main/docs/images/usrGp.png?raw=true)

Under the **Policy** tab switch to the root compartment and click **Create Policy**.
Create a policy allowing the group to read tenancy log groups and log content. Add the following
policy statements:

- `allow group GrafanaLoggingUserGroup to read log-groups in tenancy`
- `allow group GrafanaLoggingUserGroup to read log-content in tenancy`
- `allow group GrafanaLoggingUserGroup to read compartments in tenancy`

![alt text](https://github.com/oracle/oci-grafana-logs/blob/main/docs/images/usrPolicy.png?raw=true)

### For compute-instance/VM on Oracle Cloud Infrastructure

#### Create a Dynamic Group for your instance

Provision an Oracle Linux [virtual machine][7] in OCI connected to a
[Virtual Cloud Network][8] with access to the public internet. If you do not
already have access to a Virtual Cloud Network with access to the public
internet you can navigate to **Virtual Cloud Networks** under **Networking** and
click **Create Virtual Cloud Network**. Choosing the `CREATE VIRTUAL CLOUD NETWORK PLUS RELATED RESOURCES` option will result in a
VCN with an Internet Routing Gateway and Route Tables configured for access to
the public internet. Three subnets will be created: one in each availability
domain in the region.

After creating your VM, the next step is to create a [dynamic group][9] used to
group virtual machine or bare metal compute instances as “principals” (similar
to user groups).

You can define the dynamic group similarly to below, where your instance is part
of the compartment given in the definition of the dynamic group.
![alt text](https://github.com/oracle/oci-grafana-logs/blob/main/docs/images/dgGroup.png?raw=true)

#### Create an IAM policy for Dynamic Group for your instance

Next, create a [policy][10] named “grafana_policy” in the root compartment of
your tenancy to permit instances in the dynamic group to make API calls against
Oracle Cloud Infrastructure services. Add the following policy statements:

- `allow dynamicgroup DynamicGroupForGrafanaInstances to read log-groups in tenancy`
- `allow dynamicgroup DynamicGroupForGrafanaInstances to read log-content in tenancy`
- `allow dynamicgroup DynamicGroupForGrafanaInstances to read compartments in tenancy`

![alt text](https://github.com/oracle/oci-grafana-logs/blob/main/docs/images/dgPolicy.png?raw=true)

#### Installation

Depending on your installation scenario you can use the following guides:

* Install Grafana and the OCI Logs plugin on a virtual machine in Oracle Cloud Infrastructure using [this document](https://github.com/oracle/oci-grafana-logs/blob/main/docs/linuxoci.md).

* Install Grafana and the OCI Logs plugin on a virtual machine in Oracle Cloud Infrastructure using Terraform using [this document](https://github.com/oracle/oci-grafana-logs/blob/main/docs/terraform.md).

* Install Grafana and the OCI Logs plugin on Kubernetes in Oracle Cloud Infrastructure using [this document](https://github.com/oracle/oci-grafana-logs/blob/main/docs/kubernetes.md)

## Note 1

The OCI Logs plugin supports the integration with Grafana Cloud with Data Source **Authentication Provider** configured as **local**. See [this document](https://github.com/oracle/oci-grafana-logs/blob/master/docs/grafanacloud.md) for additional information.

## Documentation

Please refer to the [docs folder in this GitHub repository](https://github.com/oracle/oci-grafana-logs/tree/main/docs) for more information on installing and using the OCI Logging data source.

## Help

Issues and questions about this plugin can be posted
[as an issue in this GitHub repository][11].

## Contributing

This project welcomes contributions from the community. Before submitting a pull request, please [review our contribution guide](./CONTRIBUTING.md)

## Security

Please consult the [security guide](https://github.com/oracle/oci-grafana-logs/blob/main/SECURITY.md) for our responsible security
vulnerability disclosure process.

## License

Copyright (c) 2023 Oracle and/or its affiliates.

Released under the Universal Permissive License v1.0 as shown at
.

[1]: https://docs.cloud.oracle.com/en-us/iaas/Content/Logging/Concepts/loggingoverview.htm
[2]: https://docs.cloud.oracle.com/en-us/iaas/Content/Logging/Concepts/custom_logs.htm
[3]: https://docs.cloud.oracle.com/iaas/Content/API/Concepts/cliconcepts.htm
[4]: https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm
[5]: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliinstall.htm
[6]: https://docs.cloud.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm#How2
[7]: https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm
[8]: https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingVCNs.htm
[9]: https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingdynamicgroups.htm
[10]: https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/policygetstarted.htm
[11]: https://github.com/oracle/oci-grafana-logs/issues