rjenkinsjr / Auklet-Client-C

Official C/C++ Client for Auklet. Paired with the Auklet C/C++ Agent.

Home Page:https://auklet.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auklet for C

Maintainability Test Coverage

This is the C client for Auklet. It officially supports C and C++, and runs on most POSIX-based operating systems (Debian, Ubuntu Core, Raspbian, QNX, etc).

Features

  • Automatic crash reporting
  • Automatic function performance issue reporting
  • Location, system architecture, and system metrics identification for all issues
  • Ability to define data usage restrictions

Device Requirements

Auklet's C/C++ client is built to run on any POSIX operating system. If you don't see the OS or CPU architecture you are using for your application listed below, and are wondering if Auklet will be compatible, please hit us up at hello@auklet.io.

Validated OSes:
  • Debian 8.6
  • Fedora 24
  • Linaro 4.4.23
  • OpenWRT 3.8.3
  • Rasbian Jessie 4.9.30
  • Rasbian Stretch 4.14.71
  • Ubuntu 16.04
  • Yocto 2.2-r2
Validated CPU Architectures:
  • x86-64
  • ARM7
  • ARM64
  • MIPS

Networking

Auklet is built to work in network-constrained environments. It can operate while devices are not connected to the internet and then upload data once connectivity is reestablished. Auklet can also work in non-IP-based environments as well. For assistance with getting Auklet running in a non-IP-based environment contact hello@auklet.io.

Prerequisites

Before an application can send data to Auklet, it needs to be integrated with the Auklet library, libauklet.a, and then released to Auklet. See the README for the Auklet Agent for integration instructions, and the README for the Auklet Releaser for releasing instructions.

The Auklet client assumes two things:

  • It is the parent process of your program.
  • The user running the Auklet integrated app has permissions to read and write the current directory.

Quickstart

Ready to Go Architectures

If you don't see your architecture listed, it doesn't mean we can't support it, so please reach out to hello@auklet.io.

Getting Started

  1. Download the appropriate client from the list above, based on your architecture, and add it to your deployment package.

  2. Follow the C/C++ Agent Quickstart Guide to integrate the C/C++ agent.

  3. Configure the systems to which you are deploying with the following environment variables (the same ones used with the Auklet Releaser):

    • AUKLET_APP_ID
    • AUKLET_API_KEY
  4. Deploy your updated package and execute your application using the Auklet client:

     ./path/to/Auklet-Client ./path/to/<InsertYourApplication>
    

And with that, Auklet is ready to go!

Advanced Settings

Logging

The Auklet client opens an anonymous SOCK_STREAM Unix domain socket to which newline-delimited JSON messages can be written. If the Auklet client confirms that the executable has been released, the child process will inherit the socket as file descriptor 3. Otherwise, the child process will not inherit the file descriptor. Messages written to the socket will be accessible via the user interface.

Here's a C program demonstrating how to use the socket:

#include <fcntl.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>

/* getAukletLogFD checks if file descriptor 3 is valid. If so, it
 * returns the file descriptor. Otherwise, it opens /dev/null and
 * returns its file descriptor. */
int
getAukletLogFD()
{
	struct stat buf;
	int fd = 3;
	if (-1 == fstat(fd, &buf))
		fd = open("/dev/null", O_WRONLY);
	return fd;
}

int
main()
{
	int logFD = getAukletLogFD();
	dprintf(logFD, "{\"message\":\"hello, auklet\"}\n");
	close(logFD);
}

Questions? Problems? Ideas?

To get support, report a bug or suggest future ideas for Auklet, go to https://help.auklet.io and click the blue button in the lower-right corner to send a message to our support team.

About

Official C/C++ Client for Auklet. Paired with the Auklet C/C++ Agent.

https://auklet.io

License:Apache License 2.0


Languages

Language:Go 72.5%Language:JavaScript 18.0%Language:Shell 9.4%Language:Dockerfile 0.2%