Proxying Maven

Sonatype Nexus

Running Nexus

If you do not have Sonatype Nexus running, probably the easiest way to get started is to use it in a docker container (the WebUI appears on http://localhost:8081/, and the default credentials are admin/admin123):

docker run -d -p 8081:8081 --name nexus sonatype/nexus3

nexus setup

If the corresponding machine running the Nexus is only allowed to access the Internet via a HTTP proxy, you can find the form to fill in credentials when you click “HTTP” to the right.

http

Configuring Nexus

In order to proxy data between the Instana Backend and the Instana Agent, two repositories are required:

  1. agent-release
  2. shared

If you are logged in as administrator in Nexus, please configure the two proxy repos like this:

Instana Public Repository

public png

Instana Shared Repository

shared png

Agent Configuration

There are two ways to configure the newly created mirrors in the agent. Only one of them should be used:

Option A: Configuring the Mirror

The configuration for authentication and mirrors is specified in the file <agentfolder>/etc/mvn-settings.xml.

To use your On-Premises repository, uncomment the prepared section in this file:

<mirrors>
  <mirror>
    <id>agent-release</id>
    <url>http://192.168.69.3:8081/repository/agent-release</url>
    <mirrorOf>features</mirrorOf>
  </mirror>
  <mirror>
    <id>instana-shared</id>
    <url>http://192.168.69.3:8081/repository/instana-shared</url>
    <mirrorOf>shared</mirrorOf>
  </mirror>
</mirrors>

Should you require authentication for that repository, this can be configured in the same file:

<server>
  <id>agent-release</id>
  <username>myuser</username>
  <password>mypassword</password>
</server>
<server>
  <id>instana-shared</id>
  <username>myuser</username>
  <password>mypassword</password>
</server>

Option B: Changing the Repository Location

The location where the agent downloads updates and sensors is specified in the file <agentfolder>/etc/org.ops4j.pax.url.mvn.cfg.

To use your On-Premises repository, please replace the line containing org.ops4j.pax.url.mvn.repositories with your specific settings. An example configuration for the above mentioned Nexus setup on the host 192.168.69.3 on port 8081 would look like this:

org.ops4j.pax.url.mvn.repositories=http://192.168.69.3:8081/repository/agent-release@id=features@noreleases@snapshots@snapshotsUpdate=always,http://192.168.69.3:8081/repository/instana-shared@id=shared@snapshots@snapshotsUpdate=always

JFrog Artifactory

APT Mirror

NOTE: Artifactory replication settings are only relevant when the remote system is also an Artifactory Instance. Instana package repositories are not hosted on Artifactory so these settings will not be utilized here.

  • From the admin menu select remote repositories
  • Click “New” select debian
  • On the “Basic” tab enter the repository key
  • Agent repository: instana-agent-deb
  • On the “Basic” tab enter the repository URL
  • Agent Repository: https://packages.instana.io/agent/deb
  • On the “Advanced” tab enter your customer credentials
  • Username: _
  • Password: ${INSTANA_AGENT_KEY}
  • Click “Save & Finish”
  • You may now select the new repository from the “Home” menu, this will present you with instructions on configuring your systems to pull packages from Artifactory
  • will need to be replaced with: generic
  • will need to be replaced with: main
  • After you have added the package repository to a system and run apt-get update you will see that Artifactory will begin to cache artifacts

RPM Mirror

  • From the admin menu select remote repositories
  • Click “New” select rpm
  • On the “Basic” tab enter the repository key: instana-agent-rpm
  • On the “Basic” tab enter the repository URL: https://packages.instana.io/agent/rpm
  • On the “Advanced” tab enter your customer credentials
  • Username: _
  • Password: ${INSTANA_AGENT_KEY}
  • Click “Save & Finish”
  • You may now select the new repository from the “Home” menu, this will present you with instructions on configuring your systems to pull packages from Artifactory
  • <PATH_TO_REPODATA_FOLDER> will need to be replaced with: generic/x86_64
  • After you have added the package repository to a system and run yum makecache you will see that Artifactory will begin to cache artifacts