Coder Social home page Coder Social logo

instana-agent-chef's Introduction

⚠️ ⚠️ ⚠️

This repository is a blueprint to show how the Instana agent installation and configuration can be automated with Chef and is intended for others to fork and build upon. It is not actively maintained. If you have introduce new functionality on your fork that you think is useful for others, get in touch so we can link to it from here.

⚠️ ⚠️ ⚠️

instana-agent Cookbook

This Chef cookbook installs, configures and runs the monitoring agent for the Instana monitoring suite.

Flavors

instana-agent-dynamic

This blank agent comes bundled with a JDK and is configured to download all neccessary sensors when it starts. Additionally, it is configured to update its set of sensors on a daily basis.

instana-agent-static

This "gated" agent package is supposed to not connect to the internet at all. It comes with all the recent sensors and a JDK, and is your package of choice when you run a tight firewall setup.

Monitoring endpoint

If you're an onprem customer, please specify your hostname and port in the corresponding attributes. If you're using our SaaS offering, and don't know which endpoint the agent should send to, feel free to ask our sales team.

Supported operating systems

See our official documentation.

Attributes

License and Authors

Some attributes may be loaded via a chef databag: instana-agent, item: general

Example:

{
	"id": "general",
	"flavor": "static",
	"key": "your_agent_key",
	"endpoint_host": "saas-us-west-2.instana.io",
	"endpoint_port": 443,
	"mode": "apm",
	"zone": "production",
	"tags": ["tag", "another"]
}

This cookbook is being submitted and maintained under the Apache v2.0 License.

Publish to Chef Supermarket

  • Update the version number in the module’s metadata.rb file
  • Update CHANGELOG.md
  • Push changes to the module repository
  • Trigger Jenkins Job

Copyright 2017, INSTANA Inc.

instana-agent-chef's People

Contributors

doertedev-instana avatar marcelbirkner avatar rnt avatar sigil66 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

instana-agent-chef's Issues

Move away from custom data library

Using the custom data library makes it more difficult for users to override attributes as it locks them in to using a specific data bag. This cookbook should move away from the library and instead just allow users to override the attributes as they wish, either with an attributes file or in a Policyfile or even in their Chef recipe if, for example, they're using Chef Vault for the secrets.

I'd be willing to take on this task as well as Windows support but I wanted to see the thoughts before submitting a Pull Request for that work.

OS support

Hi,

I've tried to use this cookbook to install the agent on a fairly wide range of OSs, all of which should be supported according to your docs with mixed success. All the instances are less than 2 months old on AWS from official images.

What worked:
Ubuntu 16.04
Ubuntu 14.04
Amazon linux
Centos 6
Debian 9

What didn't work:
Redhat 7: Initially errored, after updating the nss package it was able to install and complete. This may not be related to the cookbook but it's certainly not handled nicely nor noted anywhere.
Redhat 6: Errors:

[2018-07-19T10:50:11-04:00] INFO: execute[yum clean metadata Instana-Agent] ran successfully
      - execute yum clean metadata --disablerepo=* --enablerepo=Instana-Agent
[2018-07-19T10:50:11-04:00] INFO: template[/etc/yum.repos.d/Instana-Agent.repo] sending run action to execute[yum-makecache-Instana-Agent] (immediate)
    * execute[yum-makecache-Instana-Agent] action run[2018-07-19T10:50:11-04:00] INFO: Processing execute[yum-makecache-Instana-Agent] action run (/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/provider/yum_repository.rb line 60)

      [execute] https://_:****************@packages.instana.io/agent/generic/x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection
                Trying other mirror.
                Error: Cannot retrieve repository metadata (repomd.xml) for repository: Instana-Agent. Please verify its path and try again

      ================================================================================
      Error executing action `run` on resource 'execute[yum-makecache-Instana-Agent]'
      ================================================================================

      Mixlib::ShellOut::ShellCommandFailed
      ------------------------------------
      Expected process to exit with [0], but received '1'
      ---- Begin output of yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent ----
      STDOUT:
      STDERR: https://_:****************@packages.instana.io/agent/generic/x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection
      Trying other mirror.
      Error: Cannot retrieve repository metadata (repomd.xml) for repository: Instana-Agent. Please verify its path and try again
      ---- End output of yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent ----
      Ran yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent returned 1

      Resource Declaration:
      ---------------------
      # In /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/provider/yum_repository.rb

       60:         declare_resource(:execute, "yum-makecache-#{new_resource.repositoryid}") do
       61:           command "yum -q -y makecache --disablerepo=* --enablerepo=#{new_resource.repositoryid}"
       62:           action :nothing
       63:           only_if { new_resource.enabled }
       64:         end
       65:

      Compiled Resource:
      ------------------
      # Declared in /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/provider/yum_repository.rb:60:in `block in <class:YumRepository>'

      execute("yum-makecache-Instana-Agent") do
        action [:nothing]
        default_guard_interpreter :execute
        command "yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent"
        backup 5
        declared_type :execute
        cookbook_name "instana-agent"
        user nil
        domain nil
        only_if { #code block }
      end

      System Info:
      ------------
      chef_version=14.2.0
      platform=redhat
      platform_version=6.7
      ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
      program_name=/usr/bin/chef-client
      executable=/opt/chef/bin/chef-client

[2018-07-19T10:50:12-04:00] INFO: Running queued delayed notifications before re-raising exception

    ================================================================================
    Error executing action `create` on resource 'yum_repository[Instana-Agent]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    execute[yum-makecache-Instana-Agent] (/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/provider/yum_repository.rb line 60) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
    ---- Begin output of yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent ----
    STDOUT:
    STDERR: https://_:****************@packages.instana.io/agent/generic/x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection
    Trying other mirror.
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: Instana-Agent. Please verify its path and try again
    ---- End output of yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent ----
    Ran yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent returned 1

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/instana-agent/recipes/system.rb

     37: yum_repository 'Instana-Agent' do
     38: 	description 'The Agent repository by Instana, Inc.'
     39: 	baseurl "#{domain}/agent/generic/x86_64"
     40: 	gpgkey gpg_path
     41: 	repo_gpgcheck true
     42: 	gpgcheck false
     43: 	action %i[create makecache]
     44: 	only_if { %w[rhel suse amazon].include? node['platform_family'] }
     45: end
     46:

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/instana-agent/recipes/system.rb:37:in `from_file'

    yum_repository("Instana-Agent") do
      action [:create, :makecache]
      updated true
      updated_by_last_action true
      default_guard_interpreter :default
      declared_type :yum_repository
      cookbook_name "instana-agent"
      recipe_name "system"
      baseurl "https://_:****************@packages.instana.io/agent/generic/x86_64"
      gpgkey "https://packages.instana.io/Instana.gpg"
      repo_gpgcheck true
      gpgcheck false
      repositoryid "Instana-Agent"
      only_if { #code block }
    end

    System Info:
    ------------
    chef_version=14.2.0
    platform=redhat
    platform_version=6.7
    ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
    program_name=/usr/bin/chef-client
    executable=/opt/chef/bin/chef-client

[2018-07-19T10:50:12-04:00] INFO: Running queued delayed notifications before re-raising exception

Running handlers:
[2018-07-19T10:50:12-04:00] ERROR: Running exception handlers
  - CRChefReporting
Running handlers complete
[2018-07-19T10:50:12-04:00] ERROR: Exception handlers complete
Chef Client failed. 6 resources updated in 57 seconds
[2018-07-19T10:50:12-04:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2018-07-19T10:50:12-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2018-07-19T10:50:12-04:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: yum_repository[Instana-Agent] (instana-agent::system line 37) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[yum-makecache-Instana-Agent] (/opt/chef/embedded/lib/ruby/gems/2.5.0/gems/chef-14.2.0/lib/chef/provider/yum_repository.rb line 60) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent ----
STDOUT:
STDERR: https://_:****************@packages.instana.io/agent/generic/x86_64/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: Instana-Agent. Please verify its path and try again
---- End output of yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent ----
Ran yum -q -y makecache --disablerepo=* --enablerepo=Instana-Agent returned 1

This is the same error that Redhat 7 originally had, however updating nss did not solve it.

Centos 7: The agent installed but fails to start:

[root@ip-10-0-1-107 ~]# service instana-agent start
Starting Instana Agent
Not running.
Instana Agent hasn't started within the timeout allowed
please review file "/opt/instana/agent/data/log/instana-agent-console.log" to see the status of the service
[root@ip-10-0-1-107 ~]# cat /opt/instana/agent/data/log/instana-agent-console.log
null
Error occurred shutting down framework: java.lang.NumberFormatException: null
java.lang.NumberFormatException: null
	at java.lang.Integer.parseInt(Integer.java:542)
	at java.lang.Integer.parseInt(Integer.java:615)
	at org.apache.karaf.main.ConfigProperties.<init>(ConfigProperties.java:214)
	at org.apache.karaf.main.Main.updateInstancePidAfterShutdown(Main.java:228)
	at org.apache.karaf.main.Main.main(Main.java:193)

I figured it would support windows as the docs point to the instana docs for supported OSs but realised that's not the case. Is this something that's expected?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.