# Getting Started with Fleet

## Quick Start Guide

This Quick Start Guide for Fleet Management enables a user to quickly enable ingesting metrics and logs into Ascent, and provides step-by-step instructions for deploying monitoring agents using Apica Fleet. By completing this tutorial, you will be able to automatically collect and forward critical server metrics and application logs directly into the Ascent product suite for complete visibility.

For the purposes of this guide, we will install and deploy both an OTEL and Fluent Bit collector agent.&#x20;

For a full video walkthrough, please refer to our video guide:

{% embed url="<https://www.youtube.com/watch?v=cNCRO2l6jOk>" %}

Let's begin:

## Part 1: Installing and Deploying an OpenTelemetry Collector Agent.

### Step 1: Install Agent Manager:

Go to -> Explore -> Fleet

Click -> Install Manager

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FqAYHSZb4wpTewvZPJ97r%2Fimage.png?alt=media&#x26;token=8fdfe6fa-4cc0-451f-adce-a7438c005ef4" alt=""><figcaption></figcaption></figure>

Select Platform: Linux

Select  Agent Type: OpenTelemetry Collector

Click 'Proceed'

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FGsAkf6qsFww3n5Kv97QF%2Fimage.png?alt=media&#x26;token=c9d66491-ee63-484c-9e9b-b14825520588" alt=""><figcaption></figcaption></figure>

Click on "Download All"

* Open 'README' file for detailed instructions.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FydIqL5pwihdhMptMlPrY%2Fimage.png?alt=media&#x26;token=6a817700-a31e-4593-897b-fe1df429afb7" alt=""><figcaption></figcaption></figure>

### Go to Your Linux Terminal:

NOTE: Transfer 'Fleet Installation File' to the Linux host that you will collect data from.

* make sure file has permissions to allow to 'execute'
* Execute the following command to install the Agent Manager:
* `$ sudo ./fleet-install.sh`

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FcbDgfXGRIx9XoJFF3f5z%2Fimage.png?alt=media&#x26;token=292d26ea-88d4-4a64-b9b7-dc2dc463eee2" alt=""><figcaption></figcaption></figure>

Verify that the hostname is in the Fleet "Agents" UI tab:&#x20;

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FdeExOVBWr7bIlLTcdGLs%2Fimage.png?alt=media&#x26;token=ebbd03a9-647e-4255-a291-fa9273b61e7c" alt=""><figcaption></figcaption></figure>

### Step 2: Update Your Configuration File:

Go to "Configurations" tab and search for:

* 'otelcol linux default config'

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2Fh7fqkVNQRXtlBzEFi1Ge%2Fimage.png?alt=media&#x26;token=dd571c4c-7cd8-4c09-aeff-c5c11bf801a3" alt=""><figcaption></figcaption></figure>

Then, click into the file to open the configuration file:

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FilhhCuxQaactTiciYp6i%2Fimage.png?alt=media&#x26;token=25ef5c42-dfa9-46a5-868a-4afeeb5d6d26" alt=""><figcaption></figcaption></figure>

Copy the below code block of the Configuration file:

NOTE: You will have to insert your \[ENV\_URL\_HERE]

* Your \[ENV\_URL\_HERE] is your domain name:

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2Fj4hPSYoPCcRHCFDrF81V%2Fimage.png?alt=media&#x26;token=2a057c08-1bd8-4504-9ccf-b088f330e73a" alt=""><figcaption></figcaption></figure>

Copy the below code block into the "Update Configuration" section in the UI:

```
receivers:
  hostmetrics:
    collection_interval: 60s
    scrapers:
      cpu:
        metrics:
          system.cpu.utilization:
            enabled: true
      memory:
        metrics:
          system.linux.memory.available:
            enabled: true
          system.memory.utilization:
            enabled: true
      disk:
      network:
      load:
      filesystem:
        include_virtual_filesystems: true
        metrics:
          system.filesystem.inodes.usage:
            enabled: true
          system.filesystem.usage:
            enabled: true
          system.filesystem.utilization:
            enabled: true
      paging:
      processes:
  filelog:
    include:
      - /var/log/syslog
      - /var/log/auth.log
    start_at: beginning
    operators:
      - type: add
        field: attributes.log_source
        value: ubuntu
      - type: move
        from: attributes["log_source"]
        to: resource["log_source"]
processors:
  attributes/os:
    actions:
      - key: ostype
        value: "linux"
        action: upsert
  attributes/host:
    actions:
      - key: hostname
        value: "{{$ .Agent.host_name }}"
        action: upsert
  batch:
    send_batch_size: 1000
    timeout: 5s
    
exporters:
  debug:
    verbosity: detailed
  prometheus:
    endpoint: 0.0.0.0:9464
  otlphttp/apicametrics:
    compression: gzip
    disable_keep_alives: true
    encoding: proto
    metrics_endpoint: "{{$ .Agent.secret.otelmetrics.endpoint }}"
    headers:
      Authorization: "Bearer {{$ .Agent.secret.otellogs.token }}"
    tls:
      insecure: false
      insecure_skip_verify: true
  otlphttp/logs:
    compression: gzip
    disable_keep_alives: true
    encoding: json
    logs_endpoint: "https://[ENV_URL_HERE]/v1/json_batch/otlplogs?namespace=Linux&application=otellogs"
    headers:
      Authorization: "Bearer {{$ .Agent.secret.otellogs.token }}"
    tls:
      insecure: false
      insecure_skip_verify: true
    sending_queue:
      queue_size: 10000
extensions:
service:
  extensions:
  pipelines:
    metrics/out:
      receivers: [hostmetrics]
      processors: [attributes/host, attributes/os]
      exporters: [otlphttp/apicametrics]
    logs/out:
      receivers: [filelog]
      processors: [attributes/host, batch]
      exporters: [otlphttp/logs]
```

NOTE: Currently, this configuration file is set up to collect syslogs. If you would like to collect different types of logs adjust the path to the logs you want to ingest:

```
   filelog:
    include:
      - /var/log/syslog
      - /var/log/auth.log
```

### Step 3: Apply the Changes Made to the Configuration File:

Copy the below code block into the "Update Configuration" section in the UI:

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FpsRMoIQqYGU7JKmWfjGO%2Fimage.png?alt=media&#x26;token=f9380877-8efc-45d1-99bc-db5dc51dadaf" alt=""><figcaption></figcaption></figure>

Click "Update".

Then, go back to the "Agent" tab and click into the Linux hostname (where you'll be ingesting data from):

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FjlfRWQcUl54crzAapz0P%2Fimage.png?alt=media&#x26;token=f996e175-f6bc-4fdf-9ad2-e65b7801cf0c" alt=""><figcaption></figcaption></figure>

### Step 4: Verify Metrics/Logs Are Being Ingested into Ascent:

Verify that logs/metrics are coming in and that it shows as "active":

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FkpYnjCGelO1op1Lyz7nJ%2Fimage.png?alt=media&#x26;token=a077ddaf-ae35-4053-9b73-75bccbbb5d4d" alt=""><figcaption></figcaption></figure>

To verify Metrics are being ingested, go to Queries -> New Query and search for the host to verify data is there:

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FK4bFr80AOMU9MvD7j7p1%2Fimage.png?alt=media&#x26;token=5848e4cd-0db2-4835-ba38-a353541ead50" alt=""><figcaption></figcaption></figure>

## Part 2: Installing and Deploying a  Fluent Bit Agent.

Similar to Part 1 (installing/deploying OTEL Agent), we will now install a Fluent Bit agent to collect logs.

### Step 1: Install Agent Manager:

Go to -> Explore -> Fleet

Click -> Install Manager

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FqAYHSZb4wpTewvZPJ97r%2Fimage.png?alt=media&#x26;token=8fdfe6fa-4cc0-451f-adce-a7438c005ef4" alt=""><figcaption></figcaption></figure>

Select Platform: Linux

Select  Agent Type: Fluent-bit

Click 'Proceed'

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2Fs3p3BjG1L5mdC3Uk1gx7%2Fimage.png?alt=media&#x26;token=cdf11fc9-5129-4205-9d6a-26c04aeec183" alt=""><figcaption></figcaption></figure>

Click on "Download All"

* Open 'README' file for detailed instructions.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FydIqL5pwihdhMptMlPrY%2Fimage.png?alt=media&#x26;token=6a817700-a31e-4593-897b-fe1df429afb7" alt=""><figcaption></figcaption></figure>

### Go to Your Linux Terminal:

NOTE: Transfer 'Fleet Installation File' to the Linux host that you will collect data from.

* make sure file has permissions to allow to 'execute'
* Execute the following command to install the Agent Manager:
* `$ sudo ./fleet-install.sh`

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FcbDgfXGRIx9XoJFF3f5z%2Fimage.png?alt=media&#x26;token=292d26ea-88d4-4a64-b9b7-dc2dc463eee2" alt=""><figcaption></figcaption></figure>

Verify that the hostname is in the Fleet "Agents" UI tab:

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FxsFKSapSagIvPJCrLN1i%2Fimage.png?alt=media&#x26;token=3f618237-12b2-4639-8f4c-1a19fee01969" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FEEloTcsoU0dRyY4dMhdr%2Fimage.png?alt=media&#x26;token=23145b9e-f15e-47b4-b8a8-39df74938dc4" alt=""><figcaption></figcaption></figure>

### Step 2: Update Your Configuration File:

1. In the configuration, specify the following:
   * The file path to your application logs.
   * The hostname attribute.
   * Your ingest token.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2F2znO0xOL9q4kZOEH9o4e%2Fimage.png?alt=media&#x26;token=3c855b21-2e6a-4c43-a0eb-bc9d76c72cf3" alt=""><figcaption></figcaption></figure>

From the Fleet UI, select the Fluent Bit agent and apply this new configuration.

You can verify that the token and hostname have been applied correctly within the agent's detail view.

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2F6tmNrT4Ag3jkdZuRKS8p%2Fimage.png?alt=media&#x26;token=dcfbd13b-fda1-4588-a417-791f40b4185d" alt=""><figcaption></figcaption></figure>

### Step 4: Verify Logs Are Being Ingested into Ascent:

Verify that logs/metrics are coming in and that it shows as "active":

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2Fn3QPmEJkdyk1EotJtnAO%2Fimage.png?alt=media&#x26;token=1e700f5d-9ba2-44ff-9b97-ced701108038" alt=""><figcaption></figcaption></figure>

Finally, go to Explore -> 'Logs & Insights' to verify the datasource is there:

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FkGGv4wGvkBY0BtSjNl1u%2Fimage.png?alt=media&#x26;token=152cfd07-e9cb-41d9-868e-5ed6796e6364" alt=""><figcaption></figcaption></figure>

Click into the "Source Application" and you can then drill down into a log entry:

<figure><img src="https://2948796384-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LmzGprckLqwd5v6bs6m%2Fuploads%2FzADkCEobBECyaV5tuELL%2Fimage.png?alt=media&#x26;token=b8ebd45a-7c77-4036-bb3a-4aefdf3463f1" alt=""><figcaption></figcaption></figure>

### Conclusion:

You have now completed the setup for both metrics and log collection using Apica Fleet. With your agents actively reporting, you can fully leverage the Ascent product suite to analyze performance, troubleshoot issues, and gain deeper insights into your system. To expand your coverage, simply repeat these steps for other hosts and applications in your infrastructure.
